blob: 3d53684f137727154370b486aea86299ebba707f [file] [log] [blame]
<html lang="en">
<head>
<title>Reserved Names - The GNU C Library</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="The GNU C Library">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Using-the-Library.html#Using-the-Library" title="Using the Library">
<link rel="prev" href="Macro-Definitions.html#Macro-Definitions" title="Macro Definitions">
<link rel="next" href="Feature-Test-Macros.html#Feature-Test-Macros" title="Feature Test Macros">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
This file documents the GNU C library.
This is Edition 0.12, last updated 2007-10-27,
of `The GNU C Library Reference Manual', for version
2.8 (Sourcery G++ Lite 2011.03-41).
Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002,
2003, 2007, 2008, 2010 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being ``Free Software Needs Free Documentation''
and ``GNU Lesser General Public License'', the Front-Cover texts being
``A GNU Manual'', and with the Back-Cover Texts as in (a) below. A
copy of the license is included in the section entitled "GNU Free
Documentation License".
(a) The FSF's Back-Cover Text is: ``You have the freedom to
copy and modify this GNU manual. Buying copies from the FSF
supports it in developing GNU and promoting software freedom.''-->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
<link rel="stylesheet" type="text/css" href="../cs.css">
</head>
<body>
<div class="node">
<a name="Reserved-Names"></a>
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="Feature-Test-Macros.html#Feature-Test-Macros">Feature Test Macros</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="Macro-Definitions.html#Macro-Definitions">Macro Definitions</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Using-the-Library.html#Using-the-Library">Using the Library</a>
<hr>
</div>
<h4 class="subsection">1.3.3 Reserved Names</h4>
<p><a name="index-reserved-names-26"></a><a name="index-name-space-27"></a>
The names of all library types, macros, variables and functions that
come from the ISO&nbsp;C<!-- /@w --> standard are reserved unconditionally; your program
<strong>may not</strong> 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:
<ul>
<li>Other people reading your code could get very confused if you were using
a function named <code>exit</code> to do something completely different from
what the standard <code>exit</code> function does, for example. Preventing
this situation helps to make your programs easier to understand and
contributes to modularity and maintainability.
<li>It avoids the possibility of a user accidentally redefining a library
function that is called by other library functions. If redefinition
were allowed, those other functions would not work properly.
<li>It allows the compiler to do whatever special optimizations it pleases
on calls to these functions, without the possibility that they may have
been redefined by the user. Some library facilities, such as those for
dealing with variadic arguments (see <a href="Variadic-Functions.html#Variadic-Functions">Variadic Functions</a>)
and non-local exits (see <a href="Non_002dLocal-Exits.html#Non_002dLocal-Exits">Non-Local Exits</a>), actually require a
considerable amount of cooperation on the part of the C compiler, and
with respect to the implementation, it might be easier for the compiler
to treat these as built-in parts of the language.
</ul>
<p>In addition to the names documented in this manual, reserved names
include all external identifiers (global functions and variables) that
begin with an underscore (&lsquo;<samp><span class="samp">_</span></samp>&rsquo;) 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.
<p>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.
<ul>
<li>Names beginning with a capital &lsquo;<samp><span class="samp">E</span></samp>&rsquo; followed a digit or uppercase
letter may be used for additional error code names. See <a href="Error-Reporting.html#Error-Reporting">Error Reporting</a>.
<li>Names that begin with either &lsquo;<samp><span class="samp">is</span></samp>&rsquo; or &lsquo;<samp><span class="samp">to</span></samp>&rsquo; followed by a
lowercase letter may be used for additional character testing and
conversion functions. See <a href="Character-Handling.html#Character-Handling">Character Handling</a>.
<li>Names that begin with &lsquo;<samp><span class="samp">LC_</span></samp>&rsquo; followed by an uppercase letter may be
used for additional macros specifying locale attributes.
See <a href="Locales.html#Locales">Locales</a>.
<li>Names of all existing mathematics functions (see <a href="Mathematics.html#Mathematics">Mathematics</a>)
suffixed with &lsquo;<samp><span class="samp">f</span></samp>&rsquo; or &lsquo;<samp><span class="samp">l</span></samp>&rsquo; are reserved for corresponding
functions that operate on <code>float</code> and <code>long double</code> arguments,
respectively.
<li>Names that begin with &lsquo;<samp><span class="samp">SIG</span></samp>&rsquo; followed by an uppercase letter are
reserved for additional signal names. See <a href="Standard-Signals.html#Standard-Signals">Standard Signals</a>.
<li>Names that begin with &lsquo;<samp><span class="samp">SIG_</span></samp>&rsquo; followed by an uppercase letter are
reserved for additional signal actions. See <a href="Basic-Signal-Handling.html#Basic-Signal-Handling">Basic Signal Handling</a>.
<li>Names beginning with &lsquo;<samp><span class="samp">str</span></samp>&rsquo;, &lsquo;<samp><span class="samp">mem</span></samp>&rsquo;, or &lsquo;<samp><span class="samp">wcs</span></samp>&rsquo; followed by a
lowercase letter are reserved for additional string and array functions.
See <a href="String-and-Array-Utilities.html#String-and-Array-Utilities">String and Array Utilities</a>.
<li>Names that end with &lsquo;<samp><span class="samp">_t</span></samp>&rsquo; are reserved for additional type names.
</ul>
<p>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.
<ul>
<li>The header file <samp><span class="file">dirent.h</span></samp> reserves names prefixed with
&lsquo;<samp><span class="samp">d_</span></samp>&rsquo;.
<a name="index-dirent_002eh-28"></a>
<li>The header file <samp><span class="file">fcntl.h</span></samp> reserves names prefixed with
&lsquo;<samp><span class="samp">l_</span></samp>&rsquo;, &lsquo;<samp><span class="samp">F_</span></samp>&rsquo;, &lsquo;<samp><span class="samp">O_</span></samp>&rsquo;, and &lsquo;<samp><span class="samp">S_</span></samp>&rsquo;.
<a name="index-fcntl_002eh-29"></a>
<li>The header file <samp><span class="file">grp.h</span></samp> reserves names prefixed with &lsquo;<samp><span class="samp">gr_</span></samp>&rsquo;.
<a name="index-grp_002eh-30"></a>
<li>The header file <samp><span class="file">limits.h</span></samp> reserves names suffixed with &lsquo;<samp><span class="samp">_MAX</span></samp>&rsquo;.
<a name="index-limits_002eh-31"></a>
<li>The header file <samp><span class="file">pwd.h</span></samp> reserves names prefixed with &lsquo;<samp><span class="samp">pw_</span></samp>&rsquo;.
<a name="index-pwd_002eh-32"></a>
<li>The header file <samp><span class="file">signal.h</span></samp> reserves names prefixed with &lsquo;<samp><span class="samp">sa_</span></samp>&rsquo;
and &lsquo;<samp><span class="samp">SA_</span></samp>&rsquo;.
<a name="index-signal_002eh-33"></a>
<li>The header file <samp><span class="file">sys/stat.h</span></samp> reserves names prefixed with &lsquo;<samp><span class="samp">st_</span></samp>&rsquo;
and &lsquo;<samp><span class="samp">S_</span></samp>&rsquo;.
<a name="index-sys_002fstat_002eh-34"></a>
<li>The header file <samp><span class="file">sys/times.h</span></samp> reserves names prefixed with &lsquo;<samp><span class="samp">tms_</span></samp>&rsquo;.
<a name="index-sys_002ftimes_002eh-35"></a>
<li>The header file <samp><span class="file">termios.h</span></samp> reserves names prefixed with &lsquo;<samp><span class="samp">c_</span></samp>&rsquo;,
&lsquo;<samp><span class="samp">V</span></samp>&rsquo;, &lsquo;<samp><span class="samp">I</span></samp>&rsquo;, &lsquo;<samp><span class="samp">O</span></samp>&rsquo;, and &lsquo;<samp><span class="samp">TC</span></samp>&rsquo;; and names prefixed with
&lsquo;<samp><span class="samp">B</span></samp>&rsquo; followed by a digit.
<a name="index-termios_002eh-36"></a></ul>
<!-- Include the section on Creature Nest Macros. -->
<!-- It is in a separate file so it can be formatted into ../NOTES. -->
</body></html>