This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Suppressing specific compiler warnings
On Wed, May 26, 2004 at 03:50:10PM -0700, Matt Austern wrote:
> foo.cc: In constructor `A::A()':
> foo.cc:3: warning: `A::y' will be initialized after
> foo.cc:2: warning: `int A::x'
>
> The name of this warning is not "`A::y' will be initialized after `int
> A::x'". It is not even "%s will be initialized after %s".
>
> My claim is that, as things stand now, warnings do not have names.
> The
> characteristics that I claim names should have:
> - Names should be brief tags. I claim that brevity and uniformity are
> more important than looking friendly as English text: maybe something
> like 'iafter' for this one, for example.
> - Names should be printed as part of the warning text.
> - Names should appear in the index of the documentation. That way, a
> user who sees a warning message can look it up by name and get more
> detailed information on what it means.
That's almost exactly the VMS approach, which would give something like
GCC-W-MEMBER_INIT_OUTOFORDER, <above text>
In that approach, there is a unique string giving a code for each message.
When the message is translated to another language, the full text is
translated but the code is not. (The first two fields are the program or
library generating the message, and its severity level, one of W for
warning, E for error, F for fatal error, or I for information).