named warnings & individual warning control
Mark Mitchell
mark@codesourcery.com
Tue Jun 22 06:18:00 GMT 2004
DJ Delorie wrote:
>Ok, I've been given a chunk of time with which to work on this
>project.
>
Yay!
>Warnings should be referenced by mnemonic, not number. The mnemonic
>should match the command line option.
>
>
In practice, the way you use this feature is that the copmiler prints
out identifiers with the messages:
warning #2515: ....
or:
warning [a_long_mnemonic]: ...
and you copy that into your code.
I don't see this as a deal-breaker, but I think I'm on the other side of
this one.
>Warning control should be documented as something that WILL change
>from release to release of the compiler; users should expect such
>controls to be a "last chance" option, and any attempt to make the
>system easier for long-term use should be discouraged. I.e.
>complaints that the #pragma to silence warning "foo" changed in this
>gcc release will be ignored.
>
>
This I do see as a major issue.
These must be stable across releases or people will be mightily
annoyed. This feature, once added, becomes part of the interface to
GCC. If you use the catalog approach, it's relatively easy to maintain
stability of numbers or mnemonics: always add to the end of the catalog,
and clear out -- but do not remove -- entries that you're no longer
using in the middle.
The "flexibility" we have now in our warning logic is probably a
mistake; it's part of why we have inconsistently worded messages
throughout the compiler. We should probably be trying to merge these
similar messages into a single message so they can be turned on/off easily.
--
Mark Mitchell
CodeSourcery, LLC
(916) 791-8304
mark@codesourcery.com
More information about the Gcc
mailing list