This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Desire gcc option to skip warnings in standard headers
- To: branko dot cibej at hermes dot si (Branko Cibej)
- Subject: Re: Desire gcc option to skip warnings in standard headers
- From: Carlo Wood <carlo at runaway dot xs4all dot nl>
- Date: Mon, 29 Jun 1998 18:17:21 +0200 (CEST)
- Cc: egcs at cygnus dot com (egcs at cygnus dot com)
| > I don't like this, I think the new option should turn
| > warning off if used, but by default give warnings for
| > system headers too.
|
| That's trivial to do, of course -- most probably I should just invert the
| meaning of the option. What about the name of the option, though? I don't like
| -W(no-)system-headers, even though I thought it up myself...
Hmm, it appears to be not logical...
Looking at most other -W options.
A #pragma seems more logical, and more flexible too.
Other compilers allow to turn off each type of
warning seperately with a #pragma, which would be
the ideal. It would introduce a boolean for each type
of warning, and I imagine we need an array for that:
An array that contains these variables, and the warnings
and some code that is used.
struct warning {
short warn_code;
const char *format;
unsigned int flags; // Contains flag to turn it on/off with a #pragma
};
enum {
warnFoo
...
};
struct warning warnings[] = {
{ warnFoo, "You're not allowed to foo around: %s", pendanticWarning },
...
...
print_warning(warnFoo, error);
...
Doesn't that look nice? :)
--
Carlo Wood <carlo@runaway.xs4all.nl>