[Fwd: size_t is defined as an `int'.]
Wed Oct 18 11:29:00 GMT 2000
This came across the RTEMS list. I would like some opinions
since it appears that the glibc on RedHat 6.2 also uses
"int". Solaris 2.x appears to use unsigned int.
Joel Sherrill, Ph.D. Director of Research & Development
joel@OARcorp.com On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985
To : rtems <rtems-users at oarcorp dot com>
Subject : size_t is defined as an `int'.
>From : Chris Johns <cjohns at cybertec dot com dot au>
Date : Fri, 01 Sep 2000 23:35:53 +1100
Organization : Cybertec Pty Ltd
Someone on a project I am working on spotted `size_t' is an `int'. The
ANSI standard states it should be an `unsigned int'. I found the
definition in a RTEMS newlib file.
typedef int size_t; /* see C Standard XXX */
I found "N843, the Final Committee Draft" of the ANSI C standard at :
To quote the section "Common definitions <stddef.h>" :
which is the unsigned integer type of the result of the sizeof
Should size_t be changed ?
Chris Johns, mailto:email@example.com mailto:firstname.lastname@example.org
More information about the Newlib