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
3
votes
3 answers
PC-Lint errors when using direct register addressing
I have an existing C-code (3rd party source, I can't change it) which will not be accepted by PC-Lint (Version 9.0). The code is running in an embedded environment, Green Hills Compiler is used.
Has anyone know-how on how to configure PC-Lint to…

user1235613
- 31
- 2
3
votes
1 answer
Pc lint "-egrep" option
I'm trying to clean up my code from misra violations using Pc-lint.
One of them is the violation to rule 11.4 in this code.
GPIO_PinState level = HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_6);
the definition of GPIOB is
#define GPIOB …

buch
- 33
- 2
3
votes
2 answers
conversion between a pointer to function and another type [MISRA 2012 Rule 11.1, required] | pclint 9074
I am using an array of function pointers as below to avoid a switch statement in the code.
void E_func1(void);
void E_func2(void);
void E_func3(void);
void (*pfGetVal[3])() = {
E_func1,
E_func2,
E_func3
};
But while running…

kapilddit
- 1,729
- 4
- 26
- 51
3
votes
1 answer
How to suppress PC-Lint Note 970 for int main(void) function?
I have a Visual Studio Windows Console application with ANSI C code. The main function definition is something like:
int main(void)
{
// do stuff
return 0;
}
However, PC-Lint reports the below message for the int type
Note 970: Use of…

Cem Polat
- 101
- 1
- 7
3
votes
2 answers
Both sides have side effects?
I ran static code analysis for MISRA 2004 and MISRA 2012 on the following C code:
BOOL_TYPE Strings_Are_Equal(const char *s1, const char *s2)
{
BOOL_TYPE result = True;
const char *str1 = s1;
const char *str2 = s2;
if (NULL == s1 || NULL ==…

Akay
- 1,092
- 12
- 32
3
votes
2 answers
How to disable evaluation of static_asserts in PC-lint
I am using C++'s static_assert feature to check things at compile time which usually should pass, e.g:
static_assert( SOME_CONSTANT < 1000u, "..." );
Running PC-lint (version 9.00k) on that code emits note 948: "Operator '<' always evaluates to…

Simon Lehmann
- 10,737
- 4
- 41
- 53
3
votes
1 answer
LINT exclude macro from evaluation
I am using LINT to check automatically generated C-sourcefiles. In these sourcefiles there is the use of those macros (simplified):
#define MACRO_CHECK(a, b, c) \
((a==b) ? b : (SET_VAR, c))
#define SET_VAR \
global_var = 0 \
In the code,…

Toby
- 3,815
- 14
- 51
- 67
3
votes
3 answers
What am I doing wrong in this lint error suppression attempt? And is there a better way?
I have the following line of code:
ftDCB.ByteSize = FT_BITS_8;
And lint (PC-lint via Visual Lint, specifically) gives me a message 1924 on it ("C-style cast -- More Effective C++ #2").
FT_BITS_8 is #defined in a third party header file, and there's…

Bob Vesterman
- 1,127
- 1
- 11
- 31
3
votes
0 answers
Lint unable to recognizing std::string class
I am trying to lint my project. But it seems like Lint is unable to recognize the classes such as std::string, std::vector and std::queue. I am using lib-std.lnt config file as well but of no use, facing the errors like following.
Error 40:…

M.Ali
- 101
- 1
- 5
3
votes
2 answers
Exclude all messages in PC-Lint
I am using PC-Lint for my C++ project.
Is there a way to switch off all error and warning messages by default, so I can then reintroduce the required messages explicitly?
I have read the chapter of the PC-Lint manual entitled "Error Inhibition…

user1424106
- 43
- 1
- 4
3
votes
2 answers
How does PC-Lint (by Gimpel) look across multiple modules?
I'm using Gimpel's PC-Lint v8.00 on a C codebase and am looking to understand how it traverses modules. The PC-lint manual only goes as far as to say that PC-Lint "looks across multiple modules". How does it do this? For example, does it start with…

alphaOri
- 87
- 3
- 6
3
votes
1 answer
How can I tell lint to track a custodial pointer to a vector?
I have some code that loops and news up some pointers and stores them in a vector:
std::vector m_octets;
...
InputBox* octet = new InputBox(rect, title, touch_num);
m_octets.push_back(octet);
In the class destructor I for_each over…

Tod
- 8,192
- 5
- 52
- 93
2
votes
2 answers
PC Lint error 714
In my CRC8.c I have this function:
BOOL isCRCValid(const UINT8 *ptr, UINT8 Len, UINT8 CRCChar){
return CRCChar == generateCRC(ptr, Len); //generareCRC returns a UINT8
}
It's is declared in CRC8.h, but PC Lint returns me the following.
Info 714:…

Daniel Grillo
- 2,368
- 4
- 37
- 62
2
votes
4 answers
Gimpel's PC-lint and Flexelint; Anyone used them?
So I've read a few magazine articles and the website for Gimpel's PC-lint and Flexelint C/C++ compiler.
It's really expensive (at least for me), but it seems like it might have some merit to warrant the cost.
So I'm wondering if anyone else has…

samoz
- 56,849
- 55
- 141
- 195
2
votes
1 answer
How to exclude some particular files in Pc-lint
While running pclint for a particular folder, its running for all the files inside that folder. If we want the pclint to omit some of the files, then how to configure it in std.lnt file?

rashok
- 12,790
- 16
- 88
- 100