This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [patch] New flag -Wsystem-headers

"Kaveh R. Ghazi" wrote:
>  > From: Branko =?iso-8859-2?Q?=C8ibej?= <>
>  >
>  >     (3) other -- removes superfluous tests system headers from warning
>  >         checks in C, C++ and Fortran front-ends, so that -Wsystem-headers
>  >         will enable those warnings, too.
>  >
>  > (1) and (2) are independent; (3) depends on (2), but can be omitted.
>  >
>  > 2000-09-15  Branko Cibej  <>
>  >
>  >      * c-common.c, c-decl.c, c-lex.c,, c-typeck.c:
>  >      Don't test in_system_header when checking warning conditions.
>  >      * cp/decl.c, cp/decl2.c, cp/parse.y: Likewise.
>  >      * f/lex.c (fflex_hash_): Make test of warn_unknown_pragmas
>  >      consistent with the test in c-lex.c:cb_def_pragma and
>  >      c-pragma.c:dispatch_pragma.
> Sorry I came in late on this one.  I'm not sure I agree with this last
> part.  Certain warnings like -Wtraditional are meant as portability
> aids.  Its not expected that c89 system headers would necessarily pass
> these tests or be expected to.  I don't see what benefit it is to the
> user to start showing them.
> Likewise for -pedantic, we removed a lot of fixincludes stuff under
> the assumption that we wouldn't ever issue certain of the these
> warnings in system headers.  Now they'll start unnecessarily
> blathering.

Ah. I wasn't aware of that.

> I think you may want to reconsider part 3, or at least provide levels
> e.g. -Wsystem-headers={0,1,2} as a "verbosity" flag and some of these
> would only show if warn_system_headers >= 2.
>                 Thoughts?

I think in that case it's best to leave out (3) completely. (1) and (2) are
the important bits, so maybe they should go in the way they are now.
Bits of (3) can be done later, as/if appropriate.

Regarding verbosity flags ... I think the right design would be to make
the verbosity a list of keywords with the same names as the other warning
flags (e.g., -Wsystem-headers=implicit-int,strict-prototypes), but that's
definitely more than I want to tackle at this time. As I said, I'd much
rather see (1) and (2) applied and (3) left out.


Branko Čibej                 <>
HERMES SoftLab, Litijska 51, 1000 Ljubljana, Slovenia
voice: (+386 1) 586 53 49     fax: (+386 1) 586 52 70

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]