bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: coreutils-6.3 on MacOS X


From: Bruno Haible
Subject: Re: coreutils-6.3 on MacOS X
Date: Mon, 9 Oct 2006 22:44:16 +0200
User-agent: KMail/1.9.1

Paul Eggert wrote:
>       It causes "gcc -Wall" to issue a warning, but you can work around
>       this by appending -Wno-missing-braces.

The warning that this kind of initializer (with or without the trailing
comma) elicits with "gcc -W -Wall" on glibc systems is

  foo.c:3: warning: missing initializer
  foo.c:3: warning: (near initialization for 'm.__value')

To turn off this warning one needs to pass -Wno-missing-field-initializers.
But I don't think it's a good advice to tell people to use
-Wno-missing-field-initializers. This warning was introduced because it
can catch real, nasty programming errors (namely, when you have vtable-
like structs, like in the Linux kernel, and you add one element at the
end of the struct but forget to update some of the implementations).

Similarly, -Wno-missing-braces is also a useful one, because it catches
initializer bugs with nested structs and unions. It helped me more than one
in GNU clisp.

Globally I think it's a bad tradeoff to sacrifice a gcc warning for the
sake of 7 lines of code.

Bruno




reply via email to

[Prev in Thread] Current Thread [Next in Thread]