Forum : ARM
Original Post
Post Information | Post |
---|---|
September 27, 2011 - 7:00pm
|
Hello, after months I have tried to compile again my project that was working well. As I have mentioned, months ago (with older Ride) it was compiling well. Now I get Of course editor recognizes them (blue). It must be something stupid. Have you any idea? Thanks for any help Robert I have used temporary: char, 1, 0 instead but worth to know for the future ? |
Hi,
"bool" is not C but C++, this is why you have this behavior.
What you can do is to add:
typedef enum { FALSE, TRUE } bool;
This should fix your problem.
BTW, it is better to consider that 0 is FALSE, and TRUE can be anything else.
This means that you should always write :
if(condition)...
rather than
if(condition == TRUE)...
Readability is not different (perhaps even better) and it does not confuse the compiler with unnecessary casts.
Bruno,
thanks for your very quick response - again. :-)
I have remembered that there is something strange about "bool, TRUE, FALSE" but after a months of break in working with C I have forget what exactly.
Thanks again
Robert