On 22/02/2016 8:56 PM, David Chisnall wrote:
> On 19 Feb 2016, at 23:23, Dimitry Andric <d...@freebsd.org> wrote:
>> 
>> This warning is only produced when you use -Wall -W, and then
>> initialize structs partially, i.e. you initialize some fields but
>> not others.  I think this is a quite reasonable warning for a high
>> warning level.
> 
> The warning is annoying in many ways.  You ought to be able to zero
> initialise any struct with {0}, but clang objects if you do this and
> requires every field to be filled in.  This warning really shouldn’t
> be enabled with -Wall, because it has too hight a false positive
> rate.

For the lay persons among us (I'm genuinely interested), what are the
the downsides to requiring initialization of all fields?

And in addition, the upsides, if any, of 'deferred' field initialization?

Is there a proper term for the above?

> With regard to Bruce’s comment about padding, this is a known issue
> in C11.  There is an open DR about it and it’s scheduled for
> discussion at the WG14 meeting in London in April.
> 
> David
> 

Koobs
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to