This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
cpp -Wtraditional doesn't see left justified #error in unchosen path
- To: zack at wolery dot cumb dot org
- Subject: cpp -Wtraditional doesn't see left justified #error in unchosen path
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Date: Mon, 24 Jul 2000 22:43:07 -0400 (EDT)
- Cc: gcc-bugs at gcc dot gnu dot org
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