Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1348033
| From | Peter Zijlstra <peterz@infradead.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] perf tests: initialize sa.sa_flags |
| Date | 2016-03-02 14:30 +0100 |
| Message-ID | <r8f0K-89o-17@gated-at.bofh.it> (permalink) |
| References | <r8exI-7Hb-11@gated-at.bofh.it> <r8exI-7Hb-13@gated-at.bofh.it> <r8eHo-80v-23@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Wed, Mar 02, 2016 at 10:03:50AM -0300, Arnaldo Carvalho de Melo wrote:
> > Would not something like:
> >
> > sa = (struct sigaction){
> > .sa_sigaction = segfault_handler,
> > };
> > sigfillset(&sa.sa_mask);
> >
> > Be better?
>
> I thought about that, but isn't that set in stone? This would be a 4
> liner, while his is a one' :-)
Dunno, you're right that its rather unlikely struct sigaction is going
to grow another member, but I like the above pattern better in general,
makes it harder to end up with uninitalized bits.
When performance matters the above pattern isn't ideal, but that should
not be a concern here.
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] perf tests: initialize sa.sa_flags Colin King <colin.king@canonical.com> - 2016-03-02 14:00 +0100
Re: [PATCH] perf tests: initialize sa.sa_flags Peter Zijlstra <peterz@infradead.org> - 2016-03-02 14:00 +0100
Re: [PATCH] perf tests: initialize sa.sa_flags Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-03-02 14:10 +0100
Re: [PATCH] perf tests: initialize sa.sa_flags Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-03-02 14:30 +0100
Q: why didn't GCC warn about this uninitialized variable? (was: Re: [PATCH] perf tests: initialize sa.sa_flags) Ingo Molnar <mingo@kernel.org> - 2016-03-03 13:20 +0100
Re: Q: why didn't GCC warn about this uninitialized variable? Colin Ian King <colin.king@canonical.com> - 2016-03-03 13:30 +0100
Re: Q: why didn't GCC warn about this uninitialized variable? Måns Rullgård <mans@mansr.com> - 2016-03-03 13:40 +0100
Re: Q: why didn't GCC warn about this uninitialized variable? Joe Perches <joe@perches.com> - 2016-03-03 13:50 +0100
Re: Q: why didn't GCC warn about this uninitialized variable? Ingo Molnar <mingo@kernel.org> - 2016-03-03 13:50 +0100
Re: Q: why didn't GCC warn about this uninitialized variable? (was: Re: [PATCH] perf tests: initialize sa.sa_flags) Jakub Jelinek <jakub@redhat.com> - 2016-03-03 14:00 +0100
Re: Q: why didn't GCC warn about this uninitialized variable? (was: Re: [PATCH] perf tests: initialize sa.sa_flags) Ingo Molnar <mingo@kernel.org> - 2016-03-03 14:30 +0100
Re: Q: why didn't GCC warn about this uninitialized variable? (was: Re: [PATCH] perf tests: initialize sa.sa_flags) Ingo Molnar <mingo@kernel.org> - 2016-03-03 14:50 +0100
Re: Q: why didn't GCC warn about this uninitialized variable? (was: Re: [PATCH] perf tests: initialize sa.sa_flags) Jakub Jelinek <jakub@redhat.com> - 2016-03-03 15:20 +0100
Re: Q: why didn't GCC warn about this uninitialized variable? (was: Re: [PATCH] perf tests: initialize sa.sa_flags) Ingo Molnar <mingo@kernel.org> - 2016-03-03 15:50 +0100
Re: Q: why didn't GCC warn about this uninitialized variable? (was: Re: [PATCH] perf tests: initialize sa.sa_flags) Ingo Molnar <mingo@kernel.org> - 2016-03-03 16:00 +0100
Re: Q: why didn't GCC warn about this uninitialized variable? (was: Re: [PATCH] perf tests: initialize sa.sa_flags) Ingo Molnar <mingo@kernel.org> - 2016-03-03 16:10 +0100
Re: Q: why didn't GCC warn about this uninitialized variable? (was: Re: [PATCH] perf tests: initialize sa.sa_flags) Jakub Jelinek <jakub@redhat.com> - 2016-03-03 14:50 +0100
Re: Q: why didn't GCC warn about this uninitialized variable? (was: Re: [PATCH] perf tests: initialize sa.sa_flags) Ingo Molnar <mingo@kernel.org> - 2016-03-03 15:10 +0100
Re: [PATCH] perf tests: initialize sa.sa_flags Peter Zijlstra <peterz@infradead.org> - 2016-03-02 14:30 +0100
Re: [PATCH] perf tests: initialize sa.sa_flags Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-03-02 14:10 +0100
csiph-web