GCC now supports providing the header <stdint.h> (required by C99 of 
freestanding implementations) and having information within the compiler 
about the types used in this header.  For further discussion of this and 
its benefits, see 
<http://gcc.gnu.org/ml/gcc-patches/2008-11/msg00305.html>.

Right now, the information is present in GCC for targets using glibc or 
uClibc, bare-metal and RTEMS targets (which are taken to use newlib's 
default stdint.h types) and Solaris targets.  To get the full benefits of 
this support, the information needs adding for all OSes supported by GCC.  
This is information about all the types C99 specifies for <stdint.h>, plus 
sig_atomic_t whose limits go in that header.

To add information for a target OS, put definitions such as those in 
glibc-stdint.h, newlib-stdint.h or sol2.h in a suitable target header, and 
set use_gcc_stdint in config.gcc.  It should be set to "wrap" if the 
system has its own stdint.h header, or "provide" if it doesn't.  (There 
might be special cases when some other arrangement is needed, but I expect 
those two generally to suffice.)  Make sure the new c99-stdint-*.c tests 
pass; if they show up bugs in the system's stdint.h header (as wrapped by 
GCC with the "wrap" setting) then report those upstream and fix them in 
GCC with fixincludes.

If the system does not have stdint.h, then suitable types may be found in 
one of the following places:

* A later OS version.

* inttypes.h (some systems have headers from C9x drafts that had only 
inttypes.h and not stdint.h).

* Other headers such as sys/types.h, including possibly variant type names 
such as u_int32_t in those headers.

* As a last resort, for OSes that are no longer maintained or whose 
maintainers have had no interest in defining those types for the OS, the 
types may be invented for GCC.

At least the following OSes need the information added (for all supported 
architectures):

* Darwin
* FreeBSD
* NetBSD
* OpenBSD
* VxWorks
* alpha*-dec-osf[45]*
* VMS
* SymbianOS
* WinCE
* HP-UX
* DJGPP
* LynxOS
* Netware
* QNX
* Cygwin
* MinGW
* Interix
* IRIX
* AIX
* s390x-ibm-tpf*

-- 
Joseph S. Myers
jos...@codesourcery.com

Reply via email to