⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lint.html

📁 unix 下的C开发手册,还用详细的例程。
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<b>llib-l</b><i>x</i><b>.ln</b>or<b>llib-l</b><i>x</i>if<b>llib-l</b><i>x</i><b>.ln</b>is not readable.<p>The processing of other files is implementation-dependent.<p>The<i>lint</i>utility will recognise the following<b>-l</b>operands for standard libraries:<dl compact><dt><b>-l c</b><dd>Names the Standard C library,<b>llib-lc.ln</b>,which will contain everything else defined by the ISO&nbsp;C standard.The library searchedalso will include all functions defined by the <b>XSH</b> specification.This operand is not required tobe present to cause a search of the Standard C library.<dt><b>-l l</b><dd>Names the library<b>llib-ll.ln</b>,which will contain functions required by the C-language output of<i><a href="lex.html">lex</a></i>that are not available through the Standard C library.<dt><b>-l m</b><dd>Names the library<b>llib-lm.ln</b>,which contains the functions described by the ISO&nbsp;C standardwith prototypes in the<i><a href="../xsh/math.h.html">&lt;math.h&gt;</a></i>header.<dt><b>-l pthread</b><dd>Names the library<b>llib-lpthread.ln</b>,which contains the functions declared in<i><a href="../xsh/pthread.h.html">&lt;pthread.h&gt;</a></i>and<i><a href="../xsh/pthread_atfork.html">pthread_atfork()</a></i>referenced in<i><a href="../xsh/unistd.h.html">&lt;unistd.h&gt;</a></i>.<dt><b>-l rt</b><dd>Names the library <b>llib-lrt.ln</b>,which contains the functions described by the Realtime Feature Group.<dt><b>-l y</b><dd>Names the library<b>llib-ly.ln</b>,which contains functions required by the C-language output of<i><a href="yacc.html">yacc</a></i>that are not available through the Standard C library.</dl><p>It is unspecified whether the libraries<b>llib-lc.ln</b>,<b>llib-ll.ln</b>,<b>llib-lm.ln</b>,<b>llib-lpthread.ln</b>,<b>llib-lrt.ln</b>,or<b>llib-ly.ln</b>(or any other library accessed via<b>-l</b>)exist as regular files.</blockquote><h4><a name = "tag_001_014_1142">&nbsp;</a>STDIN</h4><blockquote>Not used.</blockquote><h4><a name = "tag_001_014_1143">&nbsp;</a>INPUT FILES</h4><blockquote>The input file must be one of the following:a<b>.c</b>suffixed text file containing C-language source or a<b>.ln</b>suffixed file of unspecified format produced bya previous invocation of<i>lint</i>with a<b>-c</b>or<b>-o</b>option.</blockquote><h4><a name = "tag_001_014_1144">&nbsp;</a>ENVIRONMENT VARIABLES</h4><blockquote>The following environment variables may affect the execution of<i>lint</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></dl></blockquote><h4><a name = "tag_001_014_1145">&nbsp;</a>ASYNCHRONOUS EVENTS</h4><blockquote>Default.</blockquote><h4><a name = "tag_001_014_1146">&nbsp;</a>STDOUT</h4><blockquote>The format of the report produced by<i>lint</i>is unspecified.</blockquote><h4><a name = "tag_001_014_1147">&nbsp;</a>STDERR</h4><blockquote>Used only for diagnostic and warning messages.</blockquote><h4><a name = "tag_001_014_1148">&nbsp;</a>OUTPUT FILES</h4><blockquote>The format of<b>.ln</b>files is unspecified.</blockquote><h4><a name = "tag_001_014_1149">&nbsp;</a>EXTENDED DESCRIPTION</h4><blockquote>The<i>lint</i>utility supports the same programming environments specified in<xref href=c89><a href="c89.html#tag_000_000"></a></xref>,EXTENDED DESCRIPTION.The default programming environment supported by<i>lint</i>will be the same as the default programming environment supported by<i><a href="c89.html">c89</a></i>.To use<i>lint</i>to cross-check C-language source files and library definitions forother supported programming environments, provide the corresponding<i>lint</i>flags as the first options on the<i>lint</i>command line.<pre><table  bordercolor=#000000 border=1 align=center><tr valign=top><th align=center><b>Programming Environment<br><i>getconf</i> Name</b><th align=center><b>Corresponding <i>lint</i> Arguments<br><i>getconf</i> Name</b><tr valign=top><td align=left>_XBS5_ILP32_OFF32<td align=left>XBS5_ILP32_OFF32_LINTFLAGS<tr valign=top><td align=left>_XBS5_ILP32_OFFBIG<td align=left>XBS5_ILP32_OFFBIG_LINTFLAGS<tr valign=top><td align=left>_XBS5_LP64_OFF64<td align=left>XBS5_LP64_OFF64_LINTFLAGS<tr valign=top><td align=left>_XBS5_LPBIG_OFFBIG<td align=left>XBS5_LPBIG_OFFBIG_LINTFLAGS</table></pre><h6 align=center><xref table="Programming Environments - <I>lint</i> Flags"></xref>Table: Programming Environments - <i>lint</i> Flags</h6></blockquote><h4><a name = "tag_001_014_1150">&nbsp;</a>EXIT STATUS</h4><blockquote>The following exit values are returned:<dl compact><dt>0<dd>Successful completion.<dt>&gt;0<dd>An error occurred.</dl></blockquote><h4><a name = "tag_001_014_1151">&nbsp;</a>CONSEQUENCES OF ERRORS</h4><blockquote>Default.</blockquote><h4><a name = "tag_001_014_1152">&nbsp;</a>APPLICATION USAGE</h4><blockquote>The behaviour of the<b>-c</b>and the<b>-o</b>options allows for incremental use of<i>lint</i>on a set of C source files.Generally,<i>lint</i>is invoked once for each source file with the<b>-c</b>option.Each of these invocations produces a<b>.ln</b>file that corresponds to the<b>.c</b>file, and prints all messages thatpertain to just that source file.After all the source files have been separately run through<i>lint</i>,it is invoked once more (without the<b>-c</b>option), listing all the<b>.ln</b>files with the needed<b>-l</b>&nbsp;<i>x</i>options.This will print all the interfile inconsistencies.This scheme works well with<i><a href="make.html">make</a></i>;it allows<i><a href="make.html">make</a></i>to be used to lint only the source files that have been modified sincethe last time the set of source files were checked by<i>lint</i>.If used incrementally on a set of files, the resultof partial checks can be saved to speed subsequentintermodule consistency checks.<p>Thelintlibrary often contains all routines in that librarystripped of everything but prototypes.<p>The intent of allowing unrecognised suffixesis to permit implementations to recognise thingslike archives and source of other languages,but not require all implementations to do so.Portable applications should use only the suffixes describedin this specification.<p>Programs produced by<i><a href="lex.html">lex</a></i>or<i><a href="yacc.html">yacc</a></i>will often result in many diagnostic messages about<b>break</b>statements that cannot be reached.Use of<b>-b</b>is recommended.<br></blockquote><h4><a name = "tag_001_014_1153">&nbsp;</a>EXAMPLES</h4><blockquote>Assuming a file hierarchy as shown here:<pre><code><b>$</b> ls -R<b> libsrc:applib1.capplib2.capplib3.capplib.a appsrc:app1.capp2.c$ </b>cd libsrc</code></pre><p>The following creates<b>llib-applib.ln</b>for later use:<pre><code><b>$</b> lint -o applib applib*.c<b>$</b> cd ../appsrc</code></pre><p>The following checks the source for both applicationsagainst the previously created library:<pre><code><b>$</b> for app in *.c<b>&gt;</b> do<b>&gt;</b>        lint -L ../libsrc $app -l applib<b>&gt;</b> done</code></pre><p>If the application source and libraries in the previous example hadall been built in the _XBS5_LP64_OFF64 programming model, the<b>for</b>loop in the last example would be changed to:<pre><code><b>$</b> LFLAGS=$(getconf XBS5_LP64_OFF64_LINTFLAGS)<b>$</b> for app in *.c<b>&gt;</b> do<b>&gt;</b> lint $LFLAGS -L ../libsrc $app -l applib<b>&gt;</b> done</code></pre></blockquote><h4><a name = "tag_001_014_1154">&nbsp;</a>FUTURE DIRECTIONS</h4><blockquote>None.</blockquote><h4><a name = "tag_001_014_1155">&nbsp;</a>SEE ALSO</h4><blockquote><i><a href="cc.html">cc</a></i>,<i><a href="c89.html">c89</a></i>,<i><a href="getconf.html">getconf</a></i>,<i><a href="lex.html">lex</a></i>,<i><a href="make.html">make</a></i>,<i><a href="yacc.html">yacc</a></i>.</blockquote><hr size=2 noshade><center><font size=2>UNIX &reg; is a registered Trademark of The Open Group.<br>Copyright &copy; 1997 The Open Group<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]</font></center><hr size=2 noshade></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -