AVR C Data Types

From OpenAVR

Jump to: navigation, search

[edit] Sizes

As specified by the C standard, a plain int has the natural size of the architecture, which would be 8 bit for the AVR. However, the standard also defines, that a short int is at least 16 bits wide. It would sound quite strange to let the plain int be shorter than a short int, wouldn't it? Actually size of int has to be >= sizeof short int. Thus, the lower limit of the plain int is 16 bits as well. And this is what the GNU Compiler assumes for the AVR.

GCC has a option to force int to be 8 bits. This option id not recommended due to the reason above.

Personal tools