Node:Reserved Names, Next:Feature Test Macros, Previous:Macro Definitions, Up:Using the Library
The names of all library types, macros, variables and functions that come from the ISO C standard are reserved unconditionally; your program may not redefine these names. All other library names are reserved if your program explicitly includes the header file that defines or declares them. There are several reasons for these restrictions:
exit
to do something completely different from
what the standard exit
function does, for example. Preventing
this situation helps to make your programs easier to understand and
contributes to modularity and maintainability.
In addition to the names documented in this manual, reserved names
include all external identifiers (global functions and variables) that
begin with an underscore (_
) and all identifiers regardless of
use that begin with either two underscores or an underscore followed by
a capital letter are reserved names. This is so that the library and
header files can define functions, variables, and macros for internal
purposes without risk of conflict with names in user programs.
Some additional classes of identifier names are reserved for future extensions to the C language or the POSIX.1 environment. While using these names for your own purposes right now might not cause a problem, they do raise the possibility of conflict with future versions of the C or POSIX standards, so you should avoid these names.
E
followed a digit or uppercase
letter may be used for additional error code names. See Error Reporting.
is
or to
followed by a
lowercase letter may be used for additional character testing and
conversion functions. See Character Handling.
LC_
followed by an uppercase letter may be
used for additional macros specifying locale attributes.
See Locales.
f
or l
are reserved for corresponding
functions that operate on float
and long double
arguments,
respectively.
SIG
followed by an uppercase letter are
reserved for additional signal names. See Standard Signals.
SIG_
followed by an uppercase letter are
reserved for additional signal actions. See Basic Signal Handling.
str
, mem
, or wcs
followed by a
lowercase letter are reserved for additional string and array functions.
See String and Array Utilities.
_t
are reserved for additional type names.
In addition, some individual header files reserve names beyond those that they actually define. You only need to worry about these restrictions if your program includes that particular header file.
dirent.h
reserves names prefixed with
d_
.
fcntl.h
reserves names prefixed with
l_
, F_
, O_
, and S_
.
grp.h
reserves names prefixed with gr_
.
limits.h
reserves names suffixed with _MAX
.
pwd.h
reserves names prefixed with pw_
.
signal.h
reserves names prefixed with sa_
and SA_
.
sys/stat.h
reserves names prefixed with st_
and S_
.
sys/times.h
reserves names prefixed with tms_
.
termios.h
reserves names prefixed with c_
,
V
, I
, O
, and TC
; and names prefixed with
B
followed by a digit.