RE: [EXTERNAL]: Re: Why int32_t is long int on 32 Bit Intel?

"Jon Beniston" <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
>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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.