delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/09/11/16:16:31

Date: Mon, 11 Sep 2000 09:57:01 +0200 (WET)
From: Andris Pavenis <pavenis AT lanet DOT lv>
To: bowman <bowman AT montana DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: Warning : if (x=y)
In-Reply-To: <fSyu5.3395$Ek.8792@newsfeed.slurp.net>
Message-ID: <Pine.A41.4.05.10009110953100.41154-100000@ieva06.lanet.lv>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com


On Sat, 9 Sep 2000, bowman wrote:

> 
> Thomas Harte <T DOT Harte AT btinternet DOT _c_o_m_> wrote in message
> >
> > I don't think there is one, since it is perfectly valid syntax.
> 
> Yes, it is valid, but it may not be what you intended. Using -Wall will
> gently hint that it might not be what you want to do. It is a good idea
> to use -Wall, and to know that for every warning what you have typed
> in is actually what you want to do.  sprintf("%s is fubar\n", foo) will
> compile and link too, but you'd do well to check out the warnings.
> 

I't valid, but it's often could be buggy code ('=' instead of needed
'=='). Therefore there is a warning. So write 
	if ((x=y)!=0) ...
and there will be no warnings. And it will be clear what author wants 
(also for author himself after some months ...)

Andris


- Raw text -


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