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
0
votes
1 answer

Offset of symbol 'Symbol' inconsistent

Can someone explain me PC-Lint error no. 38 with an example... 38 Offset of symbol 'Symbol' inconsistent (Location) -- A member of a class or struct appears in a different position (offset from the start of the structure) than an …
user1
  • 4,031
  • 8
  • 37
  • 66
0
votes
1 answer

PC-Lint error : Error 307: Can't open indirect file 'gcc-include-path.lnt'

I am trying to use PC-Lint on windows for exercising static code analysis on C files. I installed the software and ran the configuration setup for gcc compiler where I got the following files in the config directory: co-gcc.h, co-gcc.lnt,…
Akay
  • 1,092
  • 12
  • 32
0
votes
1 answer

IAR EWARM PC-LINT Inhibiting messages from a header included with the -header option

I am using IAR EWARM 7.4 I have followed the instructions here: http://www.safetycritical.info/library/static/pc-lint/ewb-pclint-v2.pdf I have created a header full of compiler definitions using the --predef_macros compiler option --predef_macros…
Nick
  • 1,361
  • 1
  • 14
  • 42
0
votes
2 answers

Divide project into different PC-Lint Warning Policies

I've got a question towards PC-Lint and its configuration file. At that file, I start with the following: // --- Rules -------------------------------------------------------------------------------------- // warning policy au-misra3.lnt …
Pierre Begon
  • 166
  • 13
0
votes
2 answers

PC-Lint: Ignore Library errors

I'm using PC-Lint to lint a C project. I want to ignore errors and warnings in third party libraries, but I'm not able to get this. Reading the manual, I check all #include files specified with angle brackets are considered as libraries. [...] and…
edu
  • 141
  • 2
  • 11
0
votes
2 answers

MISRA ERROR: field type should be int, unsigned int or signed int

I have used following code in my program and while running PC-Lint it throws following error: Multiple markers at this line - (lint:46) field type should be int, unsigned int or signed int [MISRA 2004 Rule 6.4, required] - (lint:960)…
abhay agrawal
  • 25
  • 2
  • 6
0
votes
0 answers

PC Lint not detecting possible use of null pointer on static member pointer variables

Inside a singleton class's static member function, instead of using getInstance(), I used the static pointer member variable directly. I did not null check it and it was null at run time, hence null pointer exception. PC lint did not notify me of…
Logesh G
  • 630
  • 1
  • 4
  • 15
0
votes
1 answer

Regex lines for PC Lint prints in Eclipse

What kind of regex spells I need to put to Eclipse 'Regex error parser' to get PC Lint prints to "problems" view (in Eclipse C/C++ Kepler). Current lint format is -"format=LINT %t%(: %f:%l %) %n %m" which prints: LINT Info: Y:\path\to\file.c:91 732…
0
votes
1 answer

How do I suppress Lint messages in regards to anonymous structs?

I am running PC-Lint 8.00x on code similar to the following: typedef union { struct { unsigned int blue : 5; unsigned int green : 6; unsigned int red : 5; }; unsigned short color_value; }…
embedded_guy
  • 1,939
  • 3
  • 24
  • 39
0
votes
1 answer

PC-Lint treating header as library header

Using PC-Lint, I'm attempting to make a header file be treated as a library header so that I can suppress messages from inside it. I'm using the library module option +libm(module.c) which should treat module.c as a library module and any headers…
alphaOri
  • 87
  • 3
  • 6
0
votes
2 answers

PC-lint / Flexelint rule against plain char

Gimpel Software's PC-lint and Flexelint have a rule "971: Use of 'char' without 'signed' or 'unsigned'", that forbids using the plain char type without specifying signedness. http://www.gimpel.com/html/pub/msg.txt I think this is misguided. If char…
Tor Klingberg
  • 4,790
  • 6
  • 41
  • 51
0
votes
1 answer

Can I lint files that use boost's ptr_vector.hpp?

I am just starting on using boost in my embedded environment. I changed a vector to use a ptr_vector and the code compiled and tested fine. I used: #include Then I went to lint the file (with Gimpel's PC Lint)…
Tod
  • 8,192
  • 5
  • 52
  • 93
-1
votes
1 answer

Could define variable 'EL_adv' at block scope [MISRA 2012 Rule 8.9, advisory] | pclint 9003 and pclint 9075

I have declared static global variable in my .c file as below. I am observing this issue for few of the static variable not all static variable. For some static variable it is not raising any warnings. static uint8 EL_adv = 0; I got below MISRA…
kapilddit
  • 1,729
  • 4
  • 26
  • 51
-1
votes
1 answer

PC Lint info 825 suppress is not working using fallthrough comment

I have a code where am getting PC Lint info 825, even though I'm using /* fallthrough */ comment. Tell me if any of my usage is wrong. Example code: case 1: case 2: case 3: { statement; } /* fallthrough */ case 4: { statement 1; statement…
vamshi
  • 183
  • 1
  • 1
  • 8
-1
votes
2 answers

Generate Lint targets using cmake (Flexelint/Linux)

I am working on a C/C++ product that only builds in the Linux environment. It is a massive code base and generating lint targets manually is going to be incredibly painful. I know that you can link Lint into cmake so cmake generates these targets…
1 2 3
9
10