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.
Questions tagged [pc-lint]
137 questions
19
votes
2 answers
in c: func(void) vs. func()
When a C function does not accept any arguments, does it have to be declared/defined with a "void" parameter by the language rules?
PC-Lint seems to have problems when there's nothing at all in the argument-list, and I was wondering if it's…

noamtm
- 12,435
- 15
- 71
- 107
8
votes
2 answers
Does MISRA C 2012 say not to use bool
I am in the early stages of framing stuff out on a new project.
I defined a function with a return type of "bool"
I got this output from PC-Lint
Including file sockets.h (hdr)
bool sock_close(uint8_t socket_id);
^
"LINT: sockets.h (52, 1) Note…

Nick
- 1,361
- 1
- 14
- 42
7
votes
2 answers
PC Lint while(TRUE) vs for(;;)
I'm using PC Lint for the first time. I was "linting" my code, when PC Lint warns me about my while(TRUE).
This is what it says:
716: while(1) ... -- A construct of the form while(1) ... was found.
Whereas this represents a constant in a context…

Daniel Grillo
- 2,368
- 4
- 37
- 62
7
votes
3 answers
MISRA 2012 violation - Type mismatch (Rules 10.1, 10.4)
I'm facing MISRA C 2012 violation that I can't understand. Following is the code:
#define I2C_CCRH_FS ((uint8_t)0x80)
#define I2C_CCRH_DUTY ((uint8_t)0x40)
#define I2C_CCRH_CCR ((uint8_t)0x0F)
typedef struct I2C_struct
{
volatile…

Salahuddin
- 1,617
- 3
- 23
- 37
7
votes
1 answer
Using PC-Lint on project with third party libraries
I have a project which includes a large third party library and am required to ensure that the project is lint-free. However, the library has several thousand errors.
Modifying the library to remove these is not an option - how would this typically…

Mark
- 1,759
- 4
- 32
- 44
6
votes
3 answers
PC Lint Warning 537: Repeated include file
How to deal with this warning from PC Lint?
I have in several files the #include . PC Lint shows me the message Warning 537: Repeated include file 'filepath\filename.h' If I delete this declaration I cannot compile.
I would like…

Daniel Grillo
- 2,368
- 4
- 37
- 62
6
votes
1 answer
Anyone have experience with PC-Lint used with Netbeans or MPLAB X IDE?
I've been using PC-Lint with MPLAB for a couple of years now and it has been really useful. MPLAB is about to change to be a netbeans based IDE and I've not found any netbeans plugins for PC-Lint.
Does anyone have experience in PC-Lint integration…

fluffyben
- 487
- 3
- 12
5
votes
2 answers
False positive Error 503 for call to template function
I have some code that PC-Lint is giving me Error 503: Boolean argument to relational on. It is a call to a template function which is defined like this:
template
void ShowWindowEx(
HWND hWnd,
int nCmdShow,
…

SvenS
- 795
- 7
- 15
4
votes
2 answers
How can I run an incremental PC-Lint using make
I would like to apply Gimpel PC-Lint to my source code in an incremental manner using Make. I want it to only run lint against the source file if the source file has changed since the last time lint was run. Is anyone doing this? How are you…

lexicalscope
- 7,158
- 6
- 37
- 57
4
votes
2 answers
How to exclude some of the "unable to open include file *.h" errors in pclint
I am using PC lint in my project. My project is compatible to build in both windows and linux. So i have used windows header(visualstudio) files and linux header files(gcc) in my project. I am running pclint entirely for all the file. Its giving…

rashok
- 12,790
- 16
- 88
- 100
4
votes
1 answer
Struct defined differently for C and C++ - is it safe? PC-Lint warns
The following declaration adds a couple of operators for compilation in a C++ file. The definition is included in both C and C++ files.
PC-Lint is reporting Error 114: Inconsistent structure declaration for tag 'Rect' but I am certain it is safe.…

Andy Dent
- 17,578
- 6
- 88
- 115
4
votes
4 answers
Does anyone have good tips for using pc-lint?
What are some best practices for using pc-lint - how to wade thru the zillion options?
I'm particularly interested in better ways to read/parse the output files.

glutz78
- 767
- 1
- 6
- 6
4
votes
0 answers
Problems with PC-LINT and gcc 4.8 / STL (on Ubuntu)
For a project we switched a project from Windows to Linux and while PC-LINT runs just fine with wine I can't get PC-LINT running with a simple test program. PC-LINT always complains about the STL headers. I went through all the Gimpel documentation…

Jahn
- 103
- 1
- 8
4
votes
2 answers
PC-lint on switch case labels: Violates MISRA C++ 2008 Required Rule 5-0-12
//some static const variables are defined
static const uint8_t FirstData = 1;
static const uint8_t SecondData = 2;
//some switch case
switch (Numdata) //Numdata is either FirstData, SecondData
{
case FirstData:
//some code
case…

learning fellow
- 97
- 1
- 7
4
votes
2 answers
C99 Designated Initializer duplicate index not flagged at all in build output or lint
I played around with designated initializers a bit the other day and noticed, to my surprise, that it is valid to use the same index more than once. What's more, it didn't even produce a compiler warning, error, or even informational statement when…

johnny
- 4,024
- 2
- 24
- 38