This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

cpp -Wtraditional doesn't see left justified #error in unchosen path


Zack,

The -Wtraditional warnings cpp is supposed to issue about #error
needing indentation for traditional C don't occur when the directive
is wrapped in an #if conditional that evaluates such that the #error
does not trigger.  E.g.:

#if 0
#error "foo"
#endif

doesn't issue a warning.  If I change the 0 to a 1, then it does.
This makes the warning pointless since #error directives are normally
in the path not taken.  However traditional C breaks if #error is left
justified even if guarded by an #if.

I noticed this because one such directive snuck into dwarf2out.c and
broke SunOS4.  I was about to scold the author of the patch when I
realized I wasn't getting any warnings myself.

Would you please change the mechanism of the #directive warnings so
that we get diagnostics even for sections of code that don't appear in
cpp's output?

		Thanks,
		--Kaveh
--
Kaveh R. Ghazi			Engagement Manager / Project Services
ghazi@caip.rutgers.edu		Qwest Internet Solutions

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]