Date: Mon, 11 Sep 2000 09:57:01 +0200 (WET) From: Andris Pavenis To: bowman cc: djgpp AT delorie DOT com Subject: Re: Warning : if (x=y) In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 Precedence: bulk On Sat, 9 Sep 2000, bowman wrote: > > Thomas Harte 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