Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / Languages / C

PC-lint 101: What does previously used .lnt file mean?

0.00/5 (No votes)
8 Jun 2009CPOL1 min read 21.1K  
A .lnt file is an indirect file, which is simply a collection of PC-lint directives.

[Note: this article was automatically created from a blog feed. The original post can be found at http://www.riverblade.co.uk/blog.php?archive=2009_02_01_archive.xml#2960367227457643954].

A .lnt file is an "indirect file", which is simply a collection of PC-lint directives. Indirect files can be nested, and are expanded in the order they are encountered by PC-lint.

However, if PC-lint encounters the same .lnt file twice in the same context during execution, it will abort with Fatal Error 314 ("Previously used .lnt file"). Hence, if you are seeing this message your analysis has failed due to an error in your PC-lint configuration, or a clash between it and the command line used.

To fix this, simply determine which .lnt file is being duplicated and remove one of the occurances. The former can be done quite simply by running PC-lint with the -vi option, which lists the .lnt files encountered, and where they were found:

Using -vi to identify where indirect files are referenced

If there is a duplicated indirect file in the configuration/command line, you will receive an error 314 when the second instance is encountered:

Using -vi to identify where a duplicated indirect file is referenced

Although this particular example is quite trivial, it illustrates on of the most common causes of fatal error 314 - specifying an indirect file on the command line when it is already in your PC-lint configuration.

In our experience the most common offenders in this are the warning policy file options.lnt and the IDE environment options files env-vc*.lnt - both of which are often specified both on the command line and within std.lnt.

To fix the error, all you need to do is remove the duplicate references to the indrect file in question - either from within your analysis configuration or (if applicable) the command line used to invoke lint-nt.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)