dotgnu-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [DotGNU]Supporting MS Error code syntax


From: Fergus Henderson
Subject: Re: [DotGNU]Supporting MS Error code syntax
Date: Fri, 8 Nov 2002 21:55:23 +1100
User-agent: Mutt/1.3.28i

On 08-Nov-2002, Rhys Weatherley <address@hidden> wrote:
> Gopal V wrote:
> 
> > do we need an error code thing ?.... It should be possible to do it without
> > disturbing anything except cscctest.
> > 
> > CCErrorOnLine(42,".....") ? anyone ?
> 
> Absolutely, positively, 100%, NOT!
> 
> Error codes are an abomination, are impossible to keep consistent
> between compiler implementations, and are against GNU coding standards.
> The GNU standard is "filename:line[:column]: message".  Which is
> why gcc never uses codes, even though dozens of other C compilers do.

This GNU standard does not exclude the possibility that "message" contains
a code identifying the kind of error.

For what it's worth, there has been discussion on the GCC list about this
in the last few months.  The discussion started in response to repeated
requests to be able to disable individual warnings via command-line
options and/or pragmas in the source code.  The conclusion was that
this feature was desirable, and that it required some way to identify
each different kind of error message.  However, these codes need
not be numeric -- using short identifiers rather than numbers would
be more mnemonic.  Also, the codes need not be output by default;
but there does need to be an option to output them, so that users
can see which code they need to use to disable a given option.

Currently no-one has gotten around to implementing it yet, but it
will probably show up eventually in some future version of GCC.

> in my opinion, warnings should never be ignored.  They should be fixed.

Some warnings are spurious, and can't be easily worked around.

In such cases, the code remains more readable if the warning is
disabled (via a pragma or equivalent) for the section of code for
which it occurs.  GCC already supports this in some cases, with
__attribute__((unused)).  However this is limited in that it only
works for warning about entities being unused.  It doesn't work
for the other warnings that GCC emits.  That's why some additional
support is needed.  The additional support will require error identifiers.

-- 
Fergus Henderson <address@hidden>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]