gcc 4.4.4 c89
I have seen this in some code I am maintaining.
#define FALSE 0
#define TRUE (!FALSE)
is there any difference in writing the following:
#define FALSE 0
#define TRUE 1
Its been used in some functions like this:
if(condition failed) {
return FALSE;
}
else {
return TRUE;
}
Many thanks for any suggestions,
One difference is, in the
(!FALSE)case, if you change:to
Your program still “works”, without modifying TRUE… however, it’s unlikely that would be safe anyways, because I’m sure your program relies on constructs such as
Which would break if you changed the definition of
FALSE. Don’t change it 🙂