📄 c99.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta name="generator" content="HTML Tidy, see www.w3.org"><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><link type="text/css" rel="stylesheet" href="style.css"><!-- Generated by The Open Group's rhtm tool v1.2.1 --><!-- Copyright (c) 2001-2003 The Open Group, All Rights Reserved --><title>c99</title></head><body bgcolor="white"><script type="text/javascript" language="JavaScript" src="../jscript/codes.js"></script><basefont size="3"> <a name="c99"></a> <a name="tag_04_12"></a><!-- c99 --> <!--header start--><center><font size="2">The Open Group Base Specifications Issue 6<br>IEEE Std 1003.1, 2003 Edition<br>Copyright © 2001-2003 The IEEE and The Open Group, All Rights reserved.</font></center><!--header end--><hr size="2" noshade><h4><a name="tag_04_12_01"></a>NAME</h4><blockquote>c99 - compile standard C programs</blockquote><h4><a name="tag_04_12_02"></a>SYNOPSIS</h4><blockquote class="synopsis"><div class="box"><code><tt><sup>[<a href="javascript:open_code('CD')">CD</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> c99</tt> <b>[</b><tt>-c</tt><b>][</b><tt>-D</tt><i>name</i><b>[</b><tt>=</tt><i>value</i><b>]]</b><tt>...</tt><b>[</b><tt>-E</tt><b>][</b><tt>-g</tt><b>][</b><tt>-I</tt><i>directory</i><b>]</b> <tt>...</tt> <b>[</b><tt>-L</tt> <i>directory</i><b>]</b><tt><br> ...</tt> <b>[</b><tt>-o</tt><i>outfile</i><b>][</b><tt>-O</tt><i>optlevel</i><b>][</b><tt>-s</tt><b>][</b><tt>-U</tt> <i>name</i><b>]</b><tt>...</tt><i>operand</i> <tt>... <img src="../images/opt-end.gif" alt="[Option End]" border="0"></tt></code></div></blockquote><h4><a name="tag_04_12_03"></a>DESCRIPTION</h4><blockquote><p>The <i>c99</i> utility is an interface to the standard C compilation system; it shall accept source code conforming to theISO C standard. The system conceptually consists of a compiler and link editor. The files referenced by <i>operand</i>s shallbe compiled and linked to produce an executable file. (It is unspecified whether the linking occurs entirely within the operationof <i>c99</i>; some implementations may produce objects that are not fully resolved until the file is executed.)</p><p>If the <b>-c</b> option is specified, for all pathname operands of the form <i>file</i> <b>.c</b>, the files:</p><pre><tt>$(basename</tt> <i>pathname</i> <tt>.c).o</tt></pre><p>shall be created as the result of successful compilation. If the <b>-c</b> option is not specified, it is unspecified whethersuch <b>.o</b> files are created or deleted for the <i>file</i> <b>.c</b> operands.</p><p>If there are no options that prevent link editing (such as <b>-c</b> or <b>-E</b>), and all operands compile and link withouterror, the resulting executable file shall be written according to the <b>-o</b> <i>outfile</i> option (if present) or to the file<b>a.out</b>.</p><p>The executable file shall be created as specified in <a href="xcu_chap01.html#tag_01_07_01_04"><i>File Read, Write, andCreation</i></a> , except that the file permission bits shall be set to:</p><blockquote><pre>S_IRWXO | S_IRWXG | S_IRWXU</pre></blockquote><p>and the bits specified by the <a href="../utilities/umask.html"><i>umask</i></a> of the process shall be cleared.</p></blockquote><h4><a name="tag_04_12_04"></a>OPTIONS</h4><blockquote><p>The <i>c99</i> utility shall conform to the Base Definitions volume of IEEE Std 1003.1-2001, <a href="../basedefs/xbd_chap12.html#tag_12_02">Section 12.2, Utility Syntax Guidelines</a>, except that:</p><ul><li><p>The <b>-l</b> <i>library</i> operands have the format of options, but their position within a list of operands affects the orderin which libraries are searched.</p></li><li><p>The order of specifying the <b>-I</b> and <b>-L</b> options is significant.</p></li><li><p>Conforming applications shall specify each option separately; that is, grouping option letters (for example, <b>-cO</b>) neednot be recognized by all implementations.</p></li></ul><p>The following options shall be supported:</p><dl compact><dt><b>-c</b></dt><dd>Suppress the link-edit phase of the compilation, and do not remove any object files that are produced.</dd><dt><b>-g</b></dt><dd>Produce symbolic information in the object or executable files; the nature of this information is unspecified, and may bemodified by implementation-defined interactions with other options.</dd><dt><b>-s</b></dt><dd>Produce object or executable files, or both, from which symbolic and other information not required for proper execution usingthe <i>exec</i> family defined in the System Interfaces volume of IEEE Std 1003.1-2001 has been removed (stripped). Ifboth <b>-g</b> and <b>-s</b> options are present, the action taken is unspecified.</dd><dt><b>-o </b> <i>outfile</i></dt><dd>Use the pathname <i>outfile</i>, instead of the default <b>a.out</b>, for the executable file produced. If the <b>-o</b> optionis present with <b>-c</b> or <b>-E</b>, the result is unspecified.</dd><dt><b>-D </b> <i>name</i><b>[=</b><i>value</i><b>]</b></dt><dd><br>Define <i>name</i> as if by a C-language <b>#define</b> directive. If no = <i>value</i> is given, a value of 1 shall be used. The<b>-D</b> option has lower precedence than the <b>-U</b> option. That is, if <i>name</i> is used in both a <b>-U</b> and a<b>-D</b> option, <i>name</i> shall be undefined regardless of the order of the options. Additional implementation-defined<i>name</i>s may be provided by the compiler. Implementations shall support at least 2048 bytes of <b>-D</b> definitions and 256<i>names</i>.</dd><dt><b>-E</b></dt><dd>Copy C-language source files to standard output, expanding all preprocessor directives; no compilation shall be performed. Ifany operand is not a text file, the effects are unspecified.</dd><dt><b>-I </b> <i>directory</i></dt><dd>Change the algorithm for searching for headers whose names are not absolute pathnames to look in the directory named by the<i>directory</i> pathname before looking in the usual places. Thus, headers whose names are enclosed in double-quotes ( <tt>""</tt>) shall be searched for first in the directory of the file with the <b>#include</b> line, then in directories named in <b>-I</b>options, and last in the usual places. For headers whose names are enclosed in angle brackets ( <tt>"<>"</tt> ), the headershall be searched for only in directories named in <b>-I</b> options and then in the usual places. Directories named in <b>-I</b>options shall be searched in the order specified. Implementations shall support at least ten instances of this option in a single<i>c99</i> command invocation.</dd><dt><b>-L </b> <i>directory</i></dt><dd>Change the algorithm of searching for the libraries named in the <b>-l</b> objects to look in the directory named by the<i>directory</i> pathname before looking in the usual places. Directories named in <b>-L</b> options shall be searched in the orderspecified. Implementations shall support at least ten instances of this option in a single <i>c99</i> command invocation. If adirectory specified by a <b>-L</b> option contains files named <b>libc.a</b>, <b>libm.a</b>, <b>libl.a</b>, or <b>liby.a</b>, theresults are unspecified.</dd><dt><b>-O </b> <i>optlevel</i></dt><dd>Specify the level of code optimization. If the <i>optlevel</i> option-argument is the digit <tt>'0'</tt> , all special codeoptimizations shall be disabled. If it is the digit <tt>'1'</tt> , the nature of the optimization is unspecified. If the <b>-O</b>option is omitted, the nature of the system's default optimization is unspecified. It is unspecified whether code generated in thepresence of the <b>-O</b> 0 option is the same as that generated when <b>-O</b> is omitted. Other <i>optlevel</i> values may besupported.</dd><dt><b>-U </b> <i>name</i></dt><dd>Remove any initial definition of <i>name</i>.</dd></dl><p>Multiple instances of the <b>-D</b>, <b>-I</b>, <b>-U</b>, and <b>-L</b> options can be specified.</p></blockquote><h4><a name="tag_04_12_05"></a>OPERANDS</h4><blockquote><p>An <i>operand</i> is either in the form of a pathname or the form <b>-l</b> <i>library</i>. The application shall ensure that atleast one operand of the pathname form is specified. The following operands shall be supported:</p><dl compact><dt><i>file.</i><b>c</b></dt><dd>A C-language source file to be compiled and optionally linked. The application shall ensure that the operand is of this form ifthe <b>-c</b> option is used.</dd><dt><i>file.</i><b>a</b></dt><dd>A library of object files typically produced by the <a href="../utilities/ar.html"><i>ar</i></a> utility, and passed directlyto the link editor. Implementations may recognize implementation-defined suffixes other than <b>.a</b> as denoting object filelibraries.</dd><dt><i>file.</i><b>o</b></dt><dd>An object file produced by <i>c99</i> <b>-c</b> and passed directly to the link editor. Implementations may recognizeimplementation-defined suffixes other than <b>.o</b> as denoting object files.</dd></dl><p>The processing of other files is implementation-defined.</p><dl compact><dt><i>-l library</i></dt><dd>(The letter ell.) Search the library named: <pre><tt>lib</tt><i>library</i><tt>.a</tt></pre><p>A library shall be searched when its name is encountered, so the placement of a <b>-l</b> operand is significant. Severalstandard libraries can be specified in this manner, as described in the EXTENDED DESCRIPTION section. Implementations may recognizeimplementation-defined suffixes other than <b>.a</b> as denoting libraries.</p></dd></dl></blockquote><h4><a name="tag_04_12_06"></a>STDIN</h4><blockquote><p>Not used.</p></blockquote><h4><a name="tag_04_12_07"></a>INPUT FILES</h4><blockquote><p>The input file shall be one of the following: a text file containing a C-language source program, an object file in the formatproduced by <i>c99</i> <b>-c</b>, or a library of object files, in the format produced by archiving zero or more object files,using <a href="../utilities/ar.html"><i>ar</i></a>. Implementations may supply additional utilities that produce files in theseformats. Additional input file formats are implementation-defined.</p></blockquote><h4><a name="tag_04_12_08"></a>ENVIRONMENT VARIABLES</h4><blockquote><p>The following environment variables shall affect the execution of <i>c99</i>:</p><dl compact><dt><i>LANG</i></dt><dd>Provide a default value for the internationalization variables that are unset or null. (See the Base Definitions volume ofIEEE Std 1003.1-2001, <a href="../basedefs/xbd_chap08.html#tag_08_02">Section 8.2, Internationalization Variables</a> forthe precedence of internationalization variables used to determine the values of locale categories.)</dd><dt><i>LC_ALL</i></dt><dd>If set to a non-empty string value, override the values of all the other internationalization variables.</dd><dt><i>LC_CTYPE</i></dt><dd>Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte asopposed to multi-byte characters in arguments and input files).</dd><dt><i>LC_MESSAGES</i></dt><dd>Determine the locale that should be used to affect the format and contents of diagnostic messages written to standarderror.</dd><dt><i>NLSPATH</i></dt><dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">Determine the location of message catalogs for the processing of <i>LC_MESSAGES .</i> <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd><dt><i>TMPDIR</i></dt><dd>Provide a pathname that should override the default directory for temporary files, if any. <sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> OnXSI-conforming systems, provide a pathname that shall override the default directory for temporary files, if any. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd></dl></blockquote><h4><a name="tag_04_12_09"></a>ASYNCHRONOUS EVENTS</h4><blockquote><p>Default.</p></blockquote><h4><a name="tag_04_12_10"></a>STDOUT</h4><blockquote><p>If more than one <i>file</i> operand ending in <b>.c</b> (or possibly other unspecified suffixes) is given, for each suchfile:</p><pre><tt>"%s:\n", <</tt><i>file</i><tt>></tt></pre><p>may be written. These messages, if written, shall precede the processing of each input file; they shall not be written to thestandard output if they are written to the standard error, as described in the STDERR section.</p><p>If the <b>-E</b> option is specified, the standard output shall be a text file that represents the results of the preprocessingstage of the language; it may contain extra information appropriate for subsequent compilation passes.</p></blockquote><h4><a name="tag_04_12_11"></a>STDERR</h4><blockquote><p>The standard error shall be used only for diagnostic messages. If more than one <i>file</i> operand ending in <b>.c</b> (orpossibly other unspecified suffixes) is given, for each such file:</p><pre><tt>"%s:\n", <</tt><i>file</i><tt>></tt></pre><p>may be written to allow identification of the diagnostic and warning messages with the appropriate input file. These messages,if written, shall precede the processing of each input file; they shall not be written to the standard error if they are written tothe standard output, as described in the STDOUT section.</p><p>This utility may produce warning messages about certain conditions that do not warrant returning an error (non-zero) exitvalue.</p></blockquote><h4><a name="tag_04_12_12"></a>OUTPUT FILES</h4><blockquote><p>Object files or executable files or both are produced in unspecified formats.</p></blockquote><h4><a name="tag_04_12_13"></a>EXTENDED DESCRIPTION</h4><blockquote><h5><a name="tag_04_12_13_01"></a>Standard Libraries</h5><p>The <i>c99</i> utility shall recognize the following <b>-l</b> operands for standard libraries:</p><dl compact><dt><b>-l c</b></dt><dd>This operand shall make visible all functions referenced in the System Interfaces volume of IEEE Std 1003.1-2001,with the possible exception of those functions listed as residing in <a href="../basedefs/aio.h.html"><i><aio.h></i></a>, <ahref="../basedefs/arpa/inet.h.html"><i><arpa/inet.h></i></a>, <a href="../basedefs/complex.h.html"><i><complex.h></i></a>, <a href="../basedefs/fenv.h.html"><i><fenv.h></i></a>, <a href=
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -