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
2
votes
1 answer
Is there a way to get a report of suppressed lint messages?
I am using PC-Lint Plus and suppressing few lint warnings throughout the source code. Is there a way in PC-Lint Plus to get a report of line numbers (or file names) where someone has suppressed warnings for software risk analysis ? This will help…

Garry S
- 79
- 9
2
votes
1 answer
__asm and PCLint 9.0L Error 14: Symbol 'TS_IntDisableAsm(void)' previously defined
I using the PCLint-Check 9.0L for a Project and got the current Error Message during a Lint-Check on all Lint-Object-Files(*.lob) of the Project:
W:\DevWA\src\Platforms_h\TSPlatforms.h Error 14: Symbol 'TS_IntDisableAsm(void)' previously defined…

HoloJens
- 67
- 9
2
votes
0 answers
How to suppress single MISRA 2004 Rule for symbol in PC lint
I'm linting below code snippet at online demonstration website of PC-Lint with enabled MISRA 2004 checkings
#include
//enable some of MISRA 2004 Rules
//lint +e960
static uint8_t printf_(uint8_t a, void * b, ...);
…

Lazureus
- 462
- 4
- 19
2
votes
2 answers
Safe assign of values to bitfield in C
Suppose I have
typedef struct {
unsigned short bar : 1;
} foo_bf;
typedef union {
unsigned short val;
foo_bf bf;
} foo_t;
How do I correctly assign a value to this bitfield from an type e.g uint16_t?
uint16_t myValue = 1;
foo_t…

MergeMaster
- 71
- 4
2
votes
0 answers
Suppressing PC Lint warnings in derived classes
I am using PC Lint and have faced this problem. I have a code something like below:
class A {
public:
virtual void doSth(int* arg);
}
class B : A {
public:
void doSth(int* arg) {...}
}
One of my methods has a pointer parameter. This of…

DvN
- 21
- 1
2
votes
1 answer
Is there a way to export the predefined macros from a Keil build configuration?
Context:
I'm trying to automate some of the more mundane tasks in embedded development with Keil. The end result I'm aiming for is that clicking build in a Keil project will run a pre-build step that runs all the code through Uncrustify (a source…

P Moody
- 33
- 6
2
votes
4 answers
How to solve this lint warning "Implicit binary conversion from int to unsigned int"
here is the code:
test.cpp
unsigned short x;
bool y;
if ((x==1)&& y)
{
...
}
else
{
...
}
I got a lint message:
Note 912 Implicit binary conversion from int
to unsigned int [MISRA Rule 48]
why? and how to avoid this?

HeyJoy
- 193
- 2
- 8
2
votes
1 answer
Script to nicify pc-lint MISRA C Output
I recently acquired a trial version of some source code to check MISRA compliance before purchasing. I have run pc-lint over the C code to verify compliance, and have got an output of a huge amount of violations. I was wanting to nicify the html…

aj1
- 23
- 1
- 4
2
votes
1 answer
MISRA error 10.1 Implicit conversion of complex integer
I am writing a code under the MISRA rule. I am getting a MISRA error for the below expression
check_Val = ( ~( 0x000Fu << Src_Data ) );
//where Src_Data is uint8 and check_Val is uint32.
I analyzed the error
Violates MISRA 2004 Required Rule…

Cool_Binami
- 93
- 4
- 12
2
votes
3 answers
Process text file by indented pattern
I've tried some combinations of sed with s/regex/../ but I was not successful. So here is my question: I have a text file which look something like this (PCLint output)
--- Module A
Info: indented message 1
Note: indented message 2
…

CeeL
- 25
- 5
2
votes
1 answer
Does the order of include files matter when pclint executes?
I am finding some issue in the order the include headers are defined in the c / c++ files when i execute pclint.
Say the include order is ,
#include
#include
#include
#include
#include
#include…

user2190483
- 269
- 1
- 5
- 22
2
votes
1 answer
Lint restricted macro name list
I've encountered a PC-Lint error message (e136) :
Illegal macro name -- The ANSI standard restricts the use of certain names as
macros. defined is on the restricted list.
I cannot find any reference to such a list in the ANSI C specifications. Is…

mister270
- 366
- 1
- 15
2
votes
2 answers
how the following PC-Lint warning be cleaned in C?
I have a question about the following code:
#define NUM_DAYS 60
#define NUM_PEOPLE 30
int days[NUM_DAYS];
int people[NUM_PEOPLE];
int size;
size = sizeof(day) > sizeof(people) ? sizeof(day) : sizeof(people);
while the macros NUM_PEOPLE can be…

user2131316
- 3,111
- 12
- 39
- 53
2
votes
1 answer
Getting PC-lint to work with Visual Studio
Did anyone got Gimpel's PC-Lint 9.00j to parse the include files of Visual Studio 2012 without spewing out hundreds of bogus errors?
A subset of settings I am using (the full ones give the exact same results):
-u
+linebuf
-i"C:\Program Files…

Alex O
- 1,429
- 2
- 13
- 20
2
votes
1 answer
Disable Lint Info 768 for all struct members
I don't know if this is the right place to ask the question but I will do it anyway.
I have a problem with Lint, I am currently migrating some code from another project and there are many struct members which are currently not used in the new…

jdxe
- 83
- 1
- 6