[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [leafnode-list] 2.0b3 compile-time warnings



krasel@xxxxxxxxxxxxxxxxxxxxxxxxxxxx (Cornelius Krasel) writes:

> > * removed explicit comparisons against FALSE and TRUE (bad style)

These must die. It contradicts the sense of 'boolean' variables to
explicitly match a condition. 

if(test == TRUE) may fail in C, since TRUE can be anything except 0.



(I hope the following Pascal crap is correct, I haven't written Pascal
for like 8 years, I think you get the idea)

PROGRAM blubb;
VAR test: Boolean;

BEGIN
  test=false;
  IF test THEN BEGIN
    WriteLn('Hooray!');
  END;
END.



bool test;
if(test)  { /* do this */ }
if(!test) { /* do that */ }



Where's the difference? 
Where's the point?

-- 
Matthias Andree

-- 
leafnode-list@xxxxxxxxxxxxxxxxxxxxxxxxxxxx -- mailing list for leafnode
To unsubscribe, send mail with "unsubscribe" in the subject to the list