09.06.2013 Views

Intel XENIX 286 Programmers Guide (86) - Tenox.tc

Intel XENIX 286 Programmers Guide (86) - Tenox.tc

Intel XENIX 286 Programmers Guide (86) - Tenox.tc

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

lint: C Program Checker <strong>XENIX</strong> Programming<br />

The situation reverts to the previous default after the next expression. The -v option<br />

can be turned on for one function with the directive<br />

I* ARGSUSED *I<br />

Comments about a variable number of arguments in calls to a function can be turned off<br />

by preceding the function definition with the directive<br />

I* VARARGS *I<br />

In some cases, you may want to check the first several arguments and leave the later<br />

arguments unchecked. Do this by following the VARARGS keyword immediately with a<br />

digit giving the number of arguments that should be checked. Thus<br />

I* VARARGS2 *I<br />

causes only the first two argu ments to be checked. Finally, the directive<br />

I* LINTLIBRARY *I<br />

at the head of a file identifies this file as a library declaration file, discussed in the next<br />

section.<br />

Checking for Library Compatibility<br />

lint accepts certain library directives, such as<br />

-ly<br />

and tests the source files for compatibility with these libraries. This testing is done by<br />

accessing library description files whose names are constructed from the library<br />

directives. These files all begin with the directive<br />

I* LINTLIBRARY *I<br />

which is followed by a series of dummy function definitions. The critical parts of these<br />

definitions are the declaration of the function return type, whether the dummy function<br />

returns a value, and the number and types of argu ments to the function. The<br />

"VARARGS" and "ARGSUSED" directives can be used to specify features of the library<br />

functions.<br />

lint library files are processed almost exactly like ordinary source files. The only<br />

difference is that functions defined in a library file but not used in a source file, draw<br />

no com ments. lint does not simulate a full library search algorithm. lint does check to<br />

see if the source files contain redefinitions of library routines.<br />

By default, lint checks the programs it is given against a standard library file, which<br />

contains descriptions of the standard functions that are normally loaded when a C<br />

program is run. When the -p option is in effect, the portable libarary file is checked<br />

containing descriptions of the standard 1/0 library routines which are expected to be<br />

portable across various machines. The -n option can be used to suppress all library<br />

checking.<br />

3-1 2

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!