[EXTERNAL]: Re: Why int32_t is long int on 32 Bit Intel?
Jon Beniston
jon@beniston.com
Fri Jul 28 20:23:36 GMT 2023
>So again, just out of curiosity: what is the reason using long as int32_t on an architecture where int is suitable, too?
Long ago, there were 32-bit x86 compilers where int was 16-bit (E.g. Turbo C).
Also, are you sure it isn't gcc that's determining the type of int32_t rather than Newlib? I've not used i686-elf-gcc, but for some targets newlib defines int32_t based on __INT32_TYPE__ which is defined by gcc:
In gcc/config/newlib-stdint.h
#ifndef STDINT_LONG32
#define STDINT_LONG32 (LONG_TYPE_SIZE == 32)
#endif
...
#define INT32_TYPE (STDINT_LONG32 ? "long int" : INT_TYPE_SIZE == 32 ? "int" : SHORT_TYPE_SIZE == 32 ? "short int" : CHAR_TYPE_SIZE == 32 ? "signed char" : 0)
Cheers,
Jon
More information about the Newlib
mailing list