This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: 16-bit int


On 10/08/2012 08:45, Georg-Johann Lay wrote:
David Brown schrieb:
On 09/08/2012 13:26, Göran Steen wrote:

I use gcc version 4.3.4, where int is 32-bit variables. Is it possible to setup compiler to compile int as 16-bit variables?

The m86k port has 32-bit int, -mshort turns it to 16 bit.


The size of an int depends on the target - gcc supports dozens of
targets.  Most have 32-bit ints, but some have 16-bit ints and at
least one has a compile-time option to support 8-bit ints (though that
goes against C standards, and is deprecated on current builds).  There
are probably also targets with 64-bit ints.

You mean the avr port? int is 16 bits wide and -mint8 implements the non-standard 8-bit int. That option was broken for quite some time, see PR46261. But that PR is fixed now.

Where in the release notes did you read about deprecation of -mint8?


I thought -mint8 had been broken for so long, and that there were no plans to fix it or support it in avrlibc, especially as the main reason for its existence (inefficient code generated for uint8_t and int8_t with normal 16-bit ints) is much less of a problem with newer versions of avr-gcc.


I guess I incorrectly extrapolated from this that the option was deprecated - I certainly hadn't noticed that the PR had been fixed.

Thanks for the correction.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]