delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2002/05/27/21:21:48

From: Martin Str|mberg <ams AT ludd DOT luth DOT se>
Message-Id: <200205272056.g4RKuTs16122@speedy.ludd.luth.se>
Subject: Re: Useless warning from gcc 3.1
In-Reply-To: <3CF253C5.EB741556@yahoo.com> "from CBFalconer at May 27, 2002 11:41:57
am"
To: djgpp-workers AT delorie DOT com
Date: Mon, 27 May 2002 22:56:29 +0200 (CEST)
X-Mailer: ELM [version 2.4ME+ PL78 (25)]
MIME-Version: 1.0
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id g4S1LPZ01147
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

According to CBFalconer:
> To me a warning is just that.  It says "I know just how to handle
> this, but it is unusual and did you really mean it?".  While, as

What unusual about ``sprintf(s, "")´´? It a perfectly legal way to
initialize s to an empty string.

> you say, auto generated code can include such empty format
> strings, I can think of no reason for human generated code to do
> so, when it is most likely a typo.

No. Why shouldn't I use the above command if I did want to do the
above?

> If the compiler has to do error recovery to continue, and possibly
> suppress statements as a result, it is an error.

Ööööh... And what are you trying to say with that sentence. What has
that to do with the useless warning?

> There could well be an argument for a way of suppressing this
> particular (and other) warnings, but that does not make it
> superfluous.  Similarly I want a warning for nested comments, for
> just one further example.

Sure. I can imaging some people might want it. So let them add
"-Wcomplain-uselessyly-about-legal-code" or whatever.

> Just in case there is any doubt, I approve :-)

I approve as well.

Of not useless warnings. 


Right,

						MartinS

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019