This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] New flag -Wsystem-headers
- To: Neil Booth <NeilB at earthling dot net>
- Subject: Re: [patch] New flag -Wsystem-headers
- From: Andreas Jaeger <aj at suse dot de>
- Date: 27 Sep 2000 12:24:05 +0200
- Cc: gcc-patches at gcc dot gnu dot org
- References: <20000927081052.A26074@daikokuya.demon.co.uk>
>>>>> Neil Booth writes:
Neil> Benjamin Kosnik wrote:-
>> > The patch has caused (I think) two regressions (but you weren't cc-ed
>> > on the mail about regressions). Any ideas?
>>
>> > >gcc/testsuite/gcc.sum:FAIL: gcc.dg/cpp/syshdr.c (test for excess errors)
>> > >gcc/testsuite/gcc.sum:FAIL: gcc.dg/wtr-int-type-1.c decimal constant (test for warnings, line 40)
>>
>> Not quite sure if they are related to -Wsystem-headers. Perhaps
>> -Wno-system-headers could be used for these files...
Neil> No, the bug in cpplib was introduced by the macro changes
Neil> (e.g. CPP_PEDANTIC) for error reporting without updating the logic in
Neil> cpperror.c to compensate. I think the patch below fixes it for
Neil> cpplib. I'm bootstrapping it and have to go to my day job now, so I
Neil> won't be committing it for at least 12 hrs.
Neil> Could you investigate what changed for the front ends to cause
Neil> wtr-int-type-1.c to fail? At a glance, I don't think that has
Neil> anything to do with the preprocessor, and is probably a similar logic
Neil> problem.
Now the test failures are normal again, seems to fix the problem.
[...]
Neil> Index: cpperror.c
Neil> ===================================================================
Neil> RCS file: /cvs/gcc/egcs/gcc/cpperror.c,v
Neil> retrieving revision 1.38
Neil> diff -c -p -r1.38 cpperror.c
Neil> *** cpperror.c 2000/09/25 22:54:02 1.38
Neil> --- cpperror.c 2000/09/27 07:03:38
Neil> *************** _cpp_begin_message (pfile, code, file, l
Neil> *** 120,130 ****
Neil> switch (code)
Neil> {
Neil> case WARNING:
Neil> if (! CPP_OPTION (pfile, warnings_are_errors))
Neil> {
Neil> if (CPP_OPTION (pfile, inhibit_warnings)
Neil> - || (CPP_IN_SYSTEM_HEADER (pfile)
Neil> - && ! CPP_OPTION (pfile, warn_system_headers)))
Neil> return 0;
Neil> is_warning = 1;
Neil> }
Neil> --- 120,131 ----
Neil> switch (code)
Neil> {
Neil> case WARNING:
Neil> + if (CPP_IN_SYSTEM_HEADER (pfile)
Neil> + && ! CPP_OPTION (pfile, warn_system_headers))
Neil> + return 0;
Neil> if (! CPP_OPTION (pfile, warnings_are_errors))
Neil> {
Neil> if (CPP_OPTION (pfile, inhibit_warnings)
Add a closing brace here!
Andreas
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.inka.de
http://www.suse.de/~aj