On Mon, Jun 02, 2014 at 12:18:02PM -0400, Simo Sorce wrote:
> On Mon, 2014-06-02 at 18:15 +0200, Jakub Hrozek wrote:
> > On Mon, Jun 02, 2014 at 12:01:14PM -0400, Simo Sorce wrote:
> > > > We have a ZERO_STRUCT call precisely for this reason.
> > >
> > > If it is on the stack, we can simply declare it with a C99 initializer
> > > of 0 ?
> > > Or is this structure reused (hence needs resetting) more than once ?
> > >
> > > Simo.
> >
> > btw both clang and gcc complain about uninitialized struct in this
> > case. I consider that a compiler bug, bug it's annoying anyway..
>
> If you set "struct foo var = { 0 };" ?
> That would be odd.
Yes, I explicitly have -Wno-missing-field-initializers in my CFLAGS
because we have a couple of places in SSSD (IIRC mainly in Stef's sbus
code) that initialize structures with { 0 } and I was getting tired
about the warnings.
Here is some StackOverflow discussion on subject:
https://stackoverflow.com/questions/1538943/why-is-the-compiler-throwing-...
As usual with SO, not all comments are worth reading, but the topmost
has even some useful links.