[Mesa-dev] [PATCH 2/2] scons: don't add -Wmissing-field-initializers
Marek Olšák
maraeo at gmail.com
Thu Jan 26 07:31:41 PST 2012
On Wed, Jan 25, 2012 at 2:34 PM, Jose Fonseca <jfonseca at vmware.com> wrote:
> ----- Original Message -----
>> The warning is absolutely useless. It doesn't actually say that there
>> are
>> uninitialized variables. It points out the fact that there are
>> missing
>> initializers and that variables are initialized to zero implicitly,
>> which is
>> exactly what we want and what we commonly make use of.
>
> The warning has its uses. Imagine a structure is extended, but we forget to add initializer to fields.
>
> struct bla {
> int foo;
> int boo;
> int doo;
> };
>
> const bla = {FOO, BOO};
>
> and 0 is not a valid balue for bla::doo.
>
> Perhaps this use is infrequent enough to no be worth the warning noise.
>
> I don't mind either way, and am happy to defer to the majority opinion.
The thing is the number of false positives I was getting with this was
huge and most were just {0} or {{0}}, etc. That outweighs any
usefulness of the warning.
Marek
More information about the mesa-dev
mailing list