This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: RFC: Named warnings
DJ Delorie wrote:
Why not adopt what CSS and Xt do? Have a mnemonic but heirarchical
system of naming and categorizing warnings, and let the user specify
any part of the warning to select it? That automatically segregates
the language front ends, standards, and targets; and gives us grouping
functionality. It also allows us to isolate the logic for selecting
warnings if we treat them as "just strings" (i.e. allows for future
creation of a ".gccrc"). Example:
I like this idea as a way of organizing things. It's more complicated,
but I think it could be a sort of layer superimposed on basic machinery;
in other words, names can be arbitrary, but if you use the hierarchical
scheme for a name, you get to ask for groups of warnings "for free".
GCC's code would go from this:
if (warn_missing_protos)
warn ("missing prototype: %s", foo);
to this:
warn ("std.c99.proto.missing", "missing prototype: %s", foo);
Implementationwise, I haven't yet figured out whether enums or strings
would be better here - one can make compelling arguments for either.
I also want to be performance-aware, which encourages making flag tests
before function calls, although I hope there are few warning tests in
critical code paths.
Stan