Warnings in the C++ Front-End and GCC in General

Richard Henderson rth@cygnus.com
Mon Sep 7 19:24:00 GMT 1998

On Mon, Sep 07, 1998 at 12:44:54AM -0700, Mark Mitchell wrote:
> This patch addresses a long-standing need in GCC: the ability to
> disable individual warnings.

I don't necesarily agree that it is a need at all, but...

> This patch provides, for every C++ warning/error message, a unique
> number.

By number is particularly odious.  One, now we've got to manage
numbers.  Two, we've got to preserve numbers from revision to
revision -- they've just been enshrined as part of the GNU C API. 

In all, it sounds like a maintenance nightmare.

This could be partially mitigated by using small, cryptic keywords
instead, but I'm not sure how much that buys us either.

>   It is basically a mistake to use `#pragma' for *anything*.
> I believe this to be an over-statement.  For this particular
> situation, I think `#pragma' is the way to go.

This is largely mitigated by ISO C9x's _Pragma() which can in fact
be used within macros.  Though it still does little for actual
portability.  Not that __attribute__ or anything else does either...

As for i18n, there are better ways to go about this.  Tom Tromey
has done the work for gcc2; at some point I presume we'll import
all of that into egcs.

In all, I rather feel that this is one of those things that sounds
like a good idea but really isn't.


More information about the Gcc mailing list