From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carlo Wood To: branko.cibej@hermes.si (Branko Cibej) Cc: egcs@cygnus.com (egcs@cygnus.com) Subject: Re: Desire gcc option to skip warnings in standard headers Date: Mon, 29 Jun 1998 20:41:00 -0000 Message-id: <199806291617.SAA24744@jolan.ppro> References: <3597B270.EC811EB4@hermes.si> X-SW-Source: 1998-06/msg01082.html | > 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