because it is standard C language style.
In Arduino.h, boolean is a typedef for uint8_t. I suspect that the bool type is optimized for holding true or false, while the boolean pseudo-type is not.
'bool' is the same size as 'int' which is 2 bytes on most Arduino boards.
My mistake apparently it may be compiler, and, or architecture dependent.My results match 1 byte on the current compiler as well.Same under Windows (VS), MacOS (clang) and several version of Linux (gcc).I wonder when that changed ...
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?
And if it is correct, why do I get a 14 bytes larger program when compiling the following code:
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?
That is, increasing a variable you use from a byte to an int isn't going to increase the sketch size by a single byte.
Please enter a valid email to subscribe
We need to confirm your email address.
To complete the subscription, please click the link in the
email we just sent you.
Thank you for subscribing!
via Egeo 16