Mail Archives: djgpp/2000/09/11/16:16:31
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 -