Should warnings be issued for unrecognised pragmas ?
Joe Buck
jbuck@synopsys.com
Sat Oct 18 12:56:00 GMT 1997
> And how much is too much. Personally I suspect that most programmers
> only use -Wall occaisionally to see how their source is fairing,
No, I use -Wall all the time on every build, so do many programmers.
When I take over someone else's code who was less careful, -Wall usually
finds a bug or two.
> because they are already overwhelmed by the number of warnings it
> produces, especially if they have inherited some code from somebody
> else.
It's worth fixing the warnings.
Because large numbers of people use -Wall all the time on every build,
no warning should be added to -Wall that cannot be suppressed without
making the code worse. Since it's easy to supress compiler-specific
pragmas belonging to other compilers with #ifdef __Green_Hills__ or
the like, I don't care in this case whether -Wall objects or not.
So -Wunrecognized_pragmas could be in -Wall. On the other hand,
some of the "Effective C++" warnings can't be suppressed without
making some classes needlessly larger, so they can't be in -Wall.
More information about the Gcc
mailing list