after googling for a while I found out that bool and boolean can be used interchangeably in the Arduino IDE. Is that correct?
I personally prefer bool, because it is standard C language style. What do you think?
I prefer bool
And if it is correct, why do I get a 14 bytes larger program when compiling the following code:
is extended to 16 bits (one machine instruction) when heatingStatus
Ditto. Repeat for the remaining prints.
Another strange thing: whether or not I declare the function at line 35 as bool or boolean I always get the same compiled size.
What is wrong with the compiler?
First, even though it does work, returning 1/0 is not correct. A bool
is either true
You get the same size code because bool
are both one byte and 1/0 is essentially interchangeable with true