cpplib: Suppress warnings in system headers
Neil Booth
NeilB@earthling.net
Mon Aug 21 12:43:00 GMT 2000
Zack Weinberg wrote:-
> This seems to be the right general idea. I have one concern: I
> believe there are some cpp_pedwarn() calls that are not predicated on
> CPP_PEDANTIC. These are mandatory warnings that happen to be also
> mandated by ISO C (so we want -pedantic-errors to make them into
> errors). You need to find these and give them a way to do what they
> need. (cpp_mandatory_pedwarn? I don't mind the long name, these should
> be rare.)
I don't fully see what you mean. Are you suggesting that -pedantic-
errors should emit errors even in header files? Or that
if (code == PEDWARN)
{
if (! CPP_OPTION (pfile, pedantic))
return 0;
is_warning = ! CPP_OPTION (pfile, pedantic_errors);
}
should become
if (code == PEDWARN)
{
is_warning = ! CPP_OPTION (pfile, pedantic_errors);
if (is_warning && ! CPP_OPTION (pfile, pedantic))
return 0;
}
If what you're suggesting requires adding another category (I hope it
doesn't), can we at the same time move to
cpp_diag ();
cpp_diag_with_line ();
cpp_diag_with_file_and_line ();
where each takes an argument indicating severity, and scrap the
cpp_pedwarn, cpp_warning etc. Otherwise we start to swim in a sea of
endless variations.
Neil.
More information about the Gcc-patches
mailing list