Questions tagged [pc-lint]

A commercial software static analysis tool produced by Vector Informatik (originally by Gimpel Software) for the C and C++ languages. PC-lint examines C or C++ programs and finds potential problem areas. PC-lint can look across several modules which allows it to determine issues that a compiler normally does not point out. Options also exist for the detection of MISRA rule violations. This tag is for questions regarding the usage of PC-lint/PC lint Plus.

137 questions
1
vote
1 answer

Strange PC-Lint errors with member templates

I am currently struggling with PC-Lint (version 9.00j and l), which gives me some errors and warnings for a piece of code. The code compiles well and runs as expected. Here is a simplified version of it: #include #include…
craesh
  • 3,665
  • 3
  • 23
  • 29
1
vote
2 answers

PC-Lint needs a list of all include paths for the files to be scanned. How to get a list of all include paths recursively needed by a target in CMake?

I'm in a project where CMake is used for managing the build process. In the project there are several executables which depends on components and these components are built as static libraries. There are also dependencies between these components.…
RuTg3r
  • 11
  • 1
  • 2
1
vote
1 answer

How display a list of suppressed PC-Lint warning types

Looking for a way for PC-Lint to display all the suppressed warning types after PC-lint has completed. Context: Working on a large older project and there have been a couple of warning types that were suppressed (-e#) and not restored…
1
vote
1 answer

How to solve lint error "Reference initialization causes loss of const/volatile integrity"

PC-lint is giving me the following error: error 1561: (Warning -- Reference initialization causes loss of const/volatile integrity (arg. 'this')) when processing the last line of this code: auto sortedIter = std::find( _sortedSelectedItems.begin(),…
Salah Saleh
  • 793
  • 9
  • 29
1
vote
2 answers

Can Lint resolve the include path of Header Files

I have setup one Project Folder in which i have main Project Directory, say Main_Proj. In that folder, I have created two folders for Header_Files and Source_Files. Folder Header_Files only contains all header files. lets say module_1a.h and so on.…
Asm
  • 11
  • 1
  • 4
1
vote
1 answer

enforce std::nothrow at compile time or during static analysis

Is it possible to enforce the use of operator new strictly with std::nothrow at compile time or at least during static analysis using pc-lint? Using c++ (GCC) 4.8.3 20140911 (Red Hat 4.8.3-9) compiler.
krizajb
  • 1,715
  • 3
  • 30
  • 43
1
vote
1 answer

Per-project options in Visual Lint?

I've used Visual Lint (as a frontend for PC-lint) in the past and somehow configured it to use a different options.lnt file for different projects. My recollection, which might be incorrect, is that it was configured to automatically pick up…
Bob Vesterman
  • 1,127
  • 1
  • 11
  • 31
1
vote
2 answers

Inhibit lint message 9007

According to MISRA rule 13.5 the right hand operand of a logical && or || operator shall not contain persistent side effects. Our code is checked with PC-Lint, message 9007 (http://gimpel-online.com/MsgRef.html#9007). We have code of the…
Lord_Gestalter
  • 500
  • 1
  • 5
  • 14
1
vote
2 answers

PC Lint Error while using templates

When I run the PC lint application for the below mentioned code I get errors: The errors for line (1) are Error 129: declaration expected, identifier '__created' ignored Error 10: Expecting identifier or other declarator Error 129: declaration…
payyans4u
  • 351
  • 2
  • 5
  • 16
1
vote
0 answers

Suppress lint 429 (custodial pointer has not been freed or returned) for std::vector?

My Blah class has code that creates a new Bling (a plain old data struct) and puts it into a std::vector: Bling * const bling = new Bling; m_Blings.push_back ( bling ); And the new Bling is eventually freed in Blah's destructor: try { while (…
Bob Vesterman
  • 1,127
  • 1
  • 11
  • 31
1
vote
2 answers

How do I suppress PC-Lint errors for C99-style initialization of structure members?

I am using PC-Lint 8.00x with the following options: +v -wlib(1) +fan +fas I receive a number of error messages from PC-Lint when I run code similar to the following: typedef union { struct { unsigned int a : 4; unsigned int…
embedded_guy
  • 1,939
  • 3
  • 24
  • 39
1
vote
1 answer

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

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…
Ashwin
  • 411
  • 1
  • 10
  • 28
1
vote
2 answers

PC-Lint error assigning unsigned int value to uint32_t variable

I have the following line of code: uint32_t address = 0x40000000U; This gives the following 3 PC-Lint errors when using the au-misra2.lnt configuration file: "*** LINT: "D:\_SVN\LPC1788-32 Dev Kit\Bootloader--4\Loadware\source\led.c"(7, 35) Note…
Mark
  • 1,759
  • 4
  • 32
  • 44
1
vote
1 answer

How can PC-Lint be integrated into Qt Creator?

We have been able to integrated PC-Lint 9.00c into Visual Studio using the description in the env-vc10.lnt file. Is there any similar way or description to get PC-lint running from Qt-Creator 2.7?
MathiasWestin
  • 251
  • 4
  • 18
1
vote
0 answers

CMake and running PC-Lint at file-level in Visual Studio

Is there way to run PC-Lint either for a specific file or for the whole project in CMake-generated Visual Studio projects? Currently I'm able to run PC-Lint per-project by creating custom targets using Kitware's script, but in my environment…
ronkot
  • 5,915
  • 4
  • 27
  • 41