Vector Help

Reference Manual for PC-lint® Plus

3 The Command Line

3.1 Indirect (.lnt) files

If the extension is .lnt or equivalent (see the +lnt option), the file is processed as an indirection, in which case it may contain one or more lines of information that would otherwise be placed on the command line. Indirect files may reference other indirect files and may be nested to any depth. Indirect files and other files may be interspersed in any manner desired. Indirect files may contain comments in addition to options and files. Both the standard C-style comment /*...*/ and the C++ style comment // . . . end-of-line are supported. Comments following options should be separated by at least one space character to prevent the comment from being processed as part of the option.

Environment variables are expanded inside indirect files when surrounded by ’%’ characters. Thus an indirect file containing:

%SOURCE%/a.c   // first file 
%SOURCE%/b.c   // second file

employs the environment variable SOURCE to specify where the files are located. The environment variable specification is case sensitive.

If an indirect file is not found in the current directory, a search is made in the usual places. For example, if lin.bat contains:

C:/lintpp/pclp64 -iC:/lintpp std.lnt %*

The std.lnt will be found in the directory C:/lintpp (if not overridden by the existence of std.lnt in the current directory).

std.lnt might contain:

co.lnt 
options.lnt

This illustrates the nesting of indirect files.

3.2 Exit Code

The operating system supports the notion of an exit code whereby a program may report a byte of information back to a controlling program. By default, PC-lint Plus will return 0 if processing is completed without any fatal or internal errors and an exit code of 1 otherwise. If the frz flag is turned OFF (such as with -frz) then the exit code will default to the number of messages generated (with an upper bound of 255) and the options -exitcode , -zero , and -zero_err /+zero_err can be used to manipulate the exit code.

If run from a shell, the return value can be obtained after PC-lint Plus terminates using echo $? for the Bash shell for Linux and macOS, echo %ErrorLevel% for cmd.exe on Windows, or echo $LastExitCode on Power- Shell.

3.3 Built-in version environment variables

The following "built-in" environment variables are expanded to the corresponding version information when appearing in an option and surrounded by percent symbols.

These environment variables can be used to conditionally execute PC-lint Plus options. For example:

    -cond(%LINT_VERSION% >= 1002,true-options,false-options)