How to exclude particulr 'TI' package path from Pc-lint?

1.5k views Asked by At

I am using PC-lint on windows PC( platform) .

I am running my code but getting this errors/warning and after some percentage of running my code is getting crashed .All errors are related to linting only .

Warnings:

C:\Program Files\Texas Instruments\ndk_x_xx_xx_xxx\packages\ti\ndk\inc\usertype.h(118): Note 960: Violates MISRA 2004 Required Rule 10.6, Unsigned integer literals require a 'U' suffix

C:\Program Files\Texas Instruments\ndk_x_xx_xx_xxx\packages\ti\ndk\inc\usertype.h(145): Note 960: Violates MISRA 2004 Required Rule 10.6, Unsigned integer literals require a 'U' suffix

C:\Program Files\Texas Instruments\ndk_x_xx_xx_xxx\packages\ti\ndk\inc\socket.h(53): Note 960: Violates MISRA 2004 Required Rule 10.6, Unsigned integer literals require a 'U' suffix

C:\Program Files\Texas Instruments\ndk_x_xx_xx_xxx\packages\ti\ndk\inc\socket.h(159): Note 970: Use of modifier or type 'int' outside of a typedef [MISRA 2004 Rule 6.3] ......

As I cannot modify that ndk package .So I want to exclude that files from my linting process ...I got some old answers from stack Overflow but these are related with source files not for header files .

I am having problem in header files like usertype.h and socket.h etc etc i tried to put -efile(960,usertype.h) option in my lint.lnt file but issue was still there .

Can you please tell me the solution for this ???

-Ashwin

1

There are 1 answers

0
Johan Bezem On

If you get warnings numbered 900 and above, you are running on warning level 4, which is far too high for normal operation. I would start on warning level 1 (syntax only) and make sure everything runs properly. Then you can increase to 2 or 3, and selectively enable some individual warnings from the range 900+ and/or 1900+.

To skip certain parts in the checking process, simply remove the c/c++ source files from the configuration or command line. But make sure to retain the directories as include directories, since other files will need to include those interface headers.

The option -efile is not intended to suppress warnings within a file, but rather to suppress warnings about a file. Look in the description of the option in the manual for details.

The way to limit warnings in source code you are not responsible for is to declare that source code to be 'libraries'. The whole chapter 6 of the PC-Lint manual is devoted to this subject. You can start with -wlib(1) to use warning level 1 (syntax only) for library files, then define what you want to be considered library files with +libclass, +-libdir, and +-libh options. And if you want to see if a certain include file is considered to be a 'library'-header, run PC-Lint with the option -vf.