delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2002/06/07/16:17:25

Sender: salvador AT delorie DOT com
Message-ID: <3D0110A3.233FDFA9@inti.gov.ar>
Date: Fri, 07 Jun 2002 16:59:32 -0300
From: salvador <salvador AT inti DOT gov DOT ar>
Organization: INTI
X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.20 i686)
X-Accept-Language: es-AR, en, es
MIME-Version: 1.0
To: djgpp-workers AT delorie DOT com
Subject: Re: Useless warning from gcc 3.1
References: <200205272056 DOT g4RKuTs16122 AT speedy DOT ludd DOT luth DOT se>
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id g57Jxv420326
Reply-To: djgpp-workers AT delorie DOT com

Martin Str|mberg wrote:

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

Come on! *s=0; is much more efficient, nobody will do what you say.
If this, useless, statement is generated by some code generator you can
correct it to generate better optimized code.
I agree this is a silly warning, but you asked for -Wall ;-)
The manpage says:

       -Wall  All  of the above `-W' options combined.  These are
              all the options which pertain to usage that we rec­
              ommend  avoiding  and  that  we  believe is easy to
              avoid, even in conjunction with macros.

And this warning looks quite easy to avoid.

SET

--
Salvador Eduardo Tropea (SET). (Electronics Engineer)
Visit my home page: http://welcome.to/SetSoft or
http://www.geocities.com/SiliconValley/Vista/6552/
Alternative e-mail: set AT computer DOT org set AT ieee DOT org
Address: Curapaligue 2124, Caseros, 3 de Febrero
Buenos Aires, (1678), ARGENTINA Phone: +(5411) 4759 0013



- Raw text -


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