This is the mail archive of the newlib@sourceware.org mailing list for the newlib 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: [PATCH 64bit] ssize_t


On 02/20/2013 06:16 PM, Ralf Corsepius wrote:

GCC doesn't apply a size-based logic to define size_t, but applies
hard-coded predefined types for size_t, likely based on historic
per-target conventions.

I.e. any type-size based logic will sometimes fail:

E.g. for targets with sizeof(size_t) == sizeof(int) == sizeof(long). on
some targets GCC uses "typedef unsigned int size_t" and on other targets
GCC uses "typedef unsigned long size_t".


Real world cases:

sparc-rtems*/sparc-*elf:
#define __SIZEOF_INT__ 4
#define __SIZEOF_LONG__ 4
#define __SIZEOF_SIZE_T__ 4
#define __SIZE_TYPE__ unsigned int


i386-rtems*/i386-*elf: #define __SIZEOF_INT__ 4 #define __SIZEOF_LONG__ 4 #define __SIZEOF_SIZE_T__ 4 #define __SIZE_TYPE__ long unsigned int

Ralf


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