[PATCH] cpplib: -Wno-endif-labels
Neil Booth
neil@daikokuya.demon.co.uk
Thu Mar 21 13:02:00 GMT 2002
Phil Edwards wrote:-
> As required by ISO C, cpplib warns about the second and third 'foo' in
>
> #if foo
> ...
> #else foo
> ...
> #endif foo
>
> Some time ago Zack mentioned that an option to suppress the warning might
> be useful. I agree; the itch I'm scratching is a bunch of really old code
> that we have to keep kicking along, and is riddled with things like this.
Ugh, if we have to. Can't you fix your code? A sed script should make
it a breeze. [I dislike the endless addition of switches to GCC, that's
all.]
> gcc:
> 2002-03-21 Phil Edwards <pme@gcc.gnu.org>
>
> * cpplib.h (struct cpp_options): New member, warn_endif_labels.
Should be unconditionally set to one in cpp_post_options if -pedantic.
[You can't set it when seeing -pedantic or -pedantic-errors, since there
might be a later -Wno-endif-labels which should be ignored.]
OK with that change.
Neil.
More information about the Gcc-patches
mailing list