|
|||||
| | |||||
size_t and ssize_t
size_t must be unsigned as defined in the ANSI, POSIX, and Single UNIX standards. A signed version ssize_t is defined in POSIX and Single UNIX.
The underlying definition of size_t is in stddef.h which is part of the compiler. A small test case on my Linux 6.2 using gcc version 2.95.2 gives the following in the -E output:
typedef unsigned int size_t;
Everywhere I looked in glibc, it punts the underlying definition of size_t to stddef.h after defining __need_size_t.
......
refernceing: http://sources.redhat.com/ml/newlib/2000/msg00338.html
ssize_t example: readblock.c (at present it's under filedes/)
I ran gcc -E on that and got:
(on redhat)
typedef unsigned int size_t;
typedef int __ssize_t;
(onsolaris)
typedef unsigned int size_t;
typedef int ssize_t;
yes!! a difference!!
| Leave a Reply |