set SHORT_TYPE_SIZE to 8
David Brown
david@westcontrol.com
Mon Nov 23 15:35:00 GMT 2015
On 23/11/15 13:45, htio2 wrote:
> but avr is setting its short and int to 8 bit ....
>
The AVR is an 8-bit cpu, but "int" on the AVR is 16-bit (as is "short").
There is an option "-mint8" to make "int" and "short" 8-bit on the AVR,
but it is not supported by the libraries and I believe has been
deprecated in the compiler itself.
Even if the cpu you are porting to is 8-bit, keep short and int at
16-bit. That is the minimum required for standard C, and no one will
thank you for making a non-standard C port. Of course, you should make
heavy use of uint8_t and int8_t in library codes and any other support
code if it is an 8-bit target, but keep short and int standard.
More information about the Gcc-help
mailing list