This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: cpp oddities. was: sparc-sun-solaris2.8 headers: fixinc, cpplib
Robert Lipe wrote:-
> Another mystery to me is that this behaves differently if it's manually
> preprocessed vs. letting the wrapper do it.
Some front-end code seems to require in_system_header be 1 to be
considered in a system header; other code seems to require non-zero.
Hence why you got some warnings and not others.
This truly trivial patch seems to fix it for me (please confirm); I'll
commit this now without a bootstrap as it is obviously harmless.
Neil.
* c-lex.c (cb_file_change): Treat in_system_header as strictly
boolean (0 or 1).
Index: c-lex.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-lex.c,v
retrieving revision 1.124
diff -u -p -r1.124 c-lex.c
--- c-lex.c 2000/12/18 19:00:24 1.124
+++ c-lex.c 2000/12/18 20:34:37
@@ -230,7 +230,6 @@ cb_file_change (pfile, fc)
cpp_reader *pfile ATTRIBUTE_UNUSED;
const cpp_file_change *fc;
{
- /* Do the actions implied by the preceding numbers. */
if (fc->reason == FC_ENTER)
{
/* Don't stack the main buffer on the input stack. */
@@ -284,7 +283,7 @@ cb_file_change (pfile, fc)
}
update_header_times (fc->to.filename);
- in_system_header = fc->sysp;
+ in_system_header = fc->sysp != 0;
input_filename = fc->to.filename;
lineno = fc->to.lineno; /* Do we need this? */