📄 c89.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>c89</title></head><body bgcolor=white><center><font size=2>The Single UNIX ® Specification, Version 2<br>Copyright © 1997 The Open Group</font></center><hr size=2 noshade><xref type="10" name="c89"></xref><h4><a name = "tag_000_000_191"> </a>NAME</h4><blockquote>c89 - compile standard C programs</blockquote><h4><a name = "tag_000_000_192"> </a>SYNOPSIS</h4><blockquote><pre><code>c89 <b>[</b>-c<b>][</b>-D <i>name</i><b>[</b>=<i>value</i><b>]]</b>...<b>[</b>-E<b>][</b>-g<b>][</b>-I <i>directory</i><b>]</b> ... <b>[</b>-L <i>directory</i><b>]</b>... <b>[</b>-o <i>outfile</i><b>][</b>-O<b>][</b>-s<b>][</b>-U <i>name</i><b>]</b> ... <i>operand</i> ...</code></pre></blockquote><h4><a name = "tag_000_000_193"> </a>DESCRIPTION</h4><blockquote>The<i>c89</i>utility is an interface to the standard C compilation system;it will accept source code conforming to the ISO C standard.The system conceptually consists of acompiler and link editor.The files referenced by<i>operand</i>swill be compiled andlinked to produce an executable file.(It is unspecified whether the linking occursentirely within the operation of<i>c89</i>;some systems may produce objects that arenot fully resolved until the file is executed.)<p>If the<b>-c</b>option is specified,for all pathname operands of the form<i>file</i>.cthe files:<pre><code>$(basename <i>pathname</i> .c).o</code></pre>will be created as the result of successful compilation.If the<b>-c</b>option is not specified,it is unspecified whether such.ofiles are created or deleted for the<i>file</i>.coperands.<p>If there are no options that prevent link editing (such as<b>-c</b>or<b>-E</b>),and all operands compile andlink without error, the resulting executable file will bewritten according to the<b>-o</b> <i>outfile</i>option (if present) or to the file<b>a.out</b>.<p>The executable file will be created as specified in the <b>XSH</b> specification,except that the file permissions will be set to:<pre><dl compact><dt> <dd>S_IRWXO | S_IRWXG | S_IRWXU</dl></pre>and that the bitsspecified by the<i>umask</i>of the process will be cleared.</blockquote><h4><a name = "tag_000_000_194"> </a>OPTIONS</h4><blockquote>The<i>c89</i>utility supports the <b>XBD</b> specification, <a href="../xbd/utilconv.html#usg"><b>Utility Syntax Guidelines</b> </a> ,except that:<ul><p><li>The<b>-l</b> <i>library</i>operands have the format of options, but their positionwithin a list of operands affects the order in which librariesare searched.<p><li>The order of specifying the<b>-I</b>and<b>-L</b>options is significant.<p><li>Portable applications must specifyeach option separately; that is, grouping option letters(for example,<b>-cO</b>)need not be recognised by all implementations.<p></ul><p>The following options are supported:<dl compact><dt><b>-c</b><dd>Suppress the link-edit phase of the compilation, anddo not remove any object files that are produced.<dt><b>-g</b><dd>Produce symbolic information in the object or executablefiles; the nature of this information is unspecified,and may be modified by implementation-dependentinteractions with other options.<dt><b>-s</b><dd>Produce object or executable files, or both, from whichsymbolic and other information not required for properexecution using the <b>XSH</b> specification<i>exec</i>family has been removed (stripped).If both<b>-g</b>and<b>-s</b>options are present, the action taken is unspecified.<dt><b>-o </b><i>outfile</i><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>option is present with<b>-c</b>or<b>-E</b>,the result is unspecified.<dt><b>-D</b><i> name</i><b>[=</b><i>value</i><b>]</b><dd>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 will 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>will be undefined regardless of the order of the options.Additional implementation-dependent<i>names</i>may be provided by the compiler.Implementations support at least 2048 bytes of<b>-D</b>definitionsand 256<i>names</i>.<dt><b>-E</b><dd>Copy C-language source files to standard output, expandingall preprocessor directives; no compilation will be performed.If any operand is not a text file, the effects are unspecified.<dt><b>-I </b><i>directory</i><dd>Change the algorithm for searching for headerswhose namesare not absolute pathnamesto look in the directory named by the<i>directory</i>pathname before looking in the usual places.Thus, headerswhose names are enclosed in double-quotes (<b>""</b>)will be searched for first inthe directory of the file with the<b>#include</b>line,then in directoriesnamed in<b>-I</b>options, and last in theusual places.For headerswhose names are enclosed inangle brackets(<>),the header will be searched for onlyin directories named in<b>-I</b>options and then in theusual places.Directories named in<b>-I</b>options will be searchedin the order specified.Implementations support at least teninstances of this option in a single<i>c89</i>command invocation.<dt><b>-L </b><i>directory</i><dd>Change the algorithm of searching for the libraries named in the<b>-l</b>objects to look in the directory namedby the<i>directory</i>pathname before looking in theusual places.Directories named in<b>-L</b>options will be searched in the order specified.Implementations support at least teninstances of this option in a single<i>c89</i>command invocation.If a directory 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>,the results are unspecified.<dt><b>-O</b><dd>Optimise.The nature of the optimisation is unspecified.<dt><b>-U </b><i>name</i><dd>Remove any initial definition of<i>name</i>.</dl><p>Multiple instances of the<b>-D</b>,<b>-I</b>,<b>-U</b>and<b>-L</b>options can be specified.</blockquote><h4><a name = "tag_000_000_195"> </a>OPERANDS</h4><blockquote>An<i>operand</i>is either in the form of a pathname or the form<b>-l</b> <i>library</i>.At least one operand of the pathname form must be specified.The following operands are supported:<dl compact><dt><i>file.</i><b>c</b><dd>A C-language source file to be compiled and optionally linked.The operand must be of this form if the<b>-c</b>option is used.<dt><i>file.</i><b>a</b><dd>A library of object files typically produced by the<i><a href="ar.html">ar</a></i>utility,and passed directly to the link editor.Implementations may recogniseimplementation-dependentsuffixes other than.aas denoting object file libraries.<dt><i>file.</i><b>o</b><dd>An object file produced by<i>c89</i><b>-c</b>and passed directly to the link editor.Implementations may recogniseimplementation-dependentsuffixes other than.oas denoting object files.</dl><p>The processing of other files is implementation-dependent.<dl compact><dt><b>-l </b><i>library</i><dd>(The letter ell.)Search the library named:<pre><code>lib<i>library</i>.a</code></pre>A library will be searched when its name isencountered, so the placement of a<b>-l</b>operand is significant.Several standard libraries can be specified in this manner,as described in the EXTENDED DESCRIPTION section.Implementations may recognise implementation-dependentsuffixes other than.aas denoting libraries.</dl></blockquote><h4><a name = "tag_000_000_196"> </a>STDIN</h4><blockquote>Not used.</blockquote><h4><a name = "tag_000_000_197"> </a>INPUT FILES</h4><blockquote>The input file must be one of the following:a text file containing aC-language source program; an object file in theformat produced by<i>c89</i><b>-c</b>or a library of object files, in the format produced byarchiving zero or more object files, using<i><a href="ar.html">ar</a></i>.Implementations may supply additional utilitiesthat produce files in these formats.Additional input file formats are implementation-dependent.</blockquote><h4><a name = "tag_000_000_198"> </a>ENVIRONMENT VARIABLES</h4><blockquote>The following environment variables affect the execution of<i>c89</i>:<dl compact><dt><i>LANG</i><dd>Provide a default value for the internationalisation variablesthat are unset or null.If<i>LANG</i>is unset or null, the corresponding value from theimplementation-dependent default locale will be used.If any of the internationalisation variables contains an invalid setting, theutility will behave as if none of the variables had been defined.<dt><i>LC_ALL</i><dd>If set to a non-empty string value,override the values of all the other internationalisation variables.<dt><i>LC_CTYPE</i><dd>Determine thelocale for the interpretation of sequences of bytes of text data ascharacters (for example, single- as opposed to multi-byte charactersin arguments and input files).<dt><i>LC_MESSAGES</i><dd>Determine the locale that should be used to affectthe format and contents of diagnosticmessages written to standard error.<dt><i>NLSPATH</i><dd>Determine the location of message cataloguesfor the processing of<i>LC_MESSAGES .</i><dt><i>TMPDIR</i><dd>Provide a pathname that will override the default directory for temporary files, if any.</dl></blockquote><h4><a name = "tag_000_000_199"> </a>ASYNCHRONOUS EVENTS</h4><blockquote>Default.</blockquote><h4><a name = "tag_000_000_200"> </a>STDOUT</h4><blockquote>If more than one file operand ending in.c(or possibly other unspecified suffixes) is given,for each such file:<p><code><tt>"%s:\n"</tt>, <<i>file</i>></code>may be written.These messages, if written, will precede the processing of each input file;they will not be written to the standard output if they arewritten to the standard error, as described in the STDERR section.<p>If the<b>-E</b>option is specified, the standard output will be a text filethat represents the results of the preprocessing stage of the language;it may contain extra information appropriate for subsequentcompilation passes.</blockquote><h4><a name = "tag_000_000_201"> </a>STDERR</h4><blockquote>Used only for diagnostic messages.If more than one file operand ending in.c(or possibly other unspecified suffixes) is given,for each such file:<p><code><tt>"%s:\n"</tt>, <<i>file</i>></code>may be written to allow identification of the diagnosticand warning messages with the appropriate input file.These messages, if written, will precede the processing of each input file;they will not be written to the standard error if they arewritten to the standard output, as described in the STDOUT section.<p>This utility may produce warning messages about certainconditions that do not warrant returning an error (non-zero)exit value.</blockquote><h4><a name = "tag_000_000_202"> </a>OUTPUT FILES</h4><blockquote>Object files or executable files or both are produced in unspecified formats.</blockquote><h4><a name = "tag_000_000_203"> </a>EXTENDED DESCRIPTION</h4><blockquote><h5><a name = "tag_000_000_203_001"> </a>Standard Libraries</h5>The<i>c89</i>utility recognises the following<b>-l</b>operands for standard libraries:<dl compact><dt><b>-l c</b><dd>This operand makes visible all library functions referenced inthe <b>XSH</b> specification with the possible exception of those functions listedas residing in<i><a href="../xsh/aio.h.html"><aio.h></a></i>,<i><a href="../xsh/math.h.html"><math.h></a></i>,<i><a href="../xsh/mqueue.h.html"><mqueue.h></a></i>,<i><a href="../xsh/pthread.h.html"><pthread.h></a></i>,<i><a href="../xsh/sched.h.html"><sched.h></a></i>,<i><a href="../xsh/semaphore.h.html"><semaphore.h></a></i>,<i><a href="../xsh/pthread_atfork.html">pthread_atfork()</a></i>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -