Sun Studio 12: C User's Guide

6.8.1 Standard Headers

The standard headers are:

Table 6–2 Standard Headers

assert.h

locale.h

stddef.h

ctype.h

math.h

stdio.h

errno.h

setjmp.h

stdlib.h

float.h

signal.h

string.h

limits.h

stdarg.h

time.h

Most implementations provide more headers, but a strictly conforming 1990 ISO/IEC C program can only use these.

Other standards disagree slightly regarding the contents of some of these headers. For example, POSIX (IEEE 1003.1) specifies that fdopen is declared in stdio.h. To allow these two standards to coexist, POSIX requires the macro _POSIX_SOURCE to be #defined prior to the inclusion of any header to guarantee that these additional names exist. In its Portability Guide, X/Open has also used this macro scheme for its extensions. X/Open’s macro is _XOPEN_SOURCE.

ISO C requires the standard headers to be both self-sufficient and idempotent. No standard header needs any other header to be #included before or after it, and each standard header can be #included more than once without causing problems. The Standard also requires that its headers be #included only in safe contexts, so that the names used in the headers are guaranteed to remain unchanged.