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
1
vote
5 answers
Difference between pointer to char and pointer to word
I've been getting warnings from Lint (740 at http://www.gimpel.com/html/pub/msg.txt) to the effect that it warns me not to cast a pointer to a union to a pointer to an unsigned long. I knew I was casting incompatible types so I was using a…

tombjo
- 191
- 8
1
vote
0 answers
strange " Strong type mismatch" lint warning in case of the struct have a constructor
I have Encountered a strange "Warning 639: Strong type mismatch for type 'myip' in binary operation"
//file ip4.h
#include // which have ::ip::IPAddress
typedef ::ip::IPAddress myip;
myip myiptest; // lint Warning 639…

Abdurahman
- 628
- 8
- 16
0
votes
1 answer
Gimpel's PC Lint Value Tracking
I'm a newbie to this site, so if I mess up any question-asking etiquette here I apologize in advance... Thanks!
This is extremely simplified example code, but I think it shows what I'm talking about: I have a C++ method that makes a call into…

Harley Freeman
- 45
- 5
0
votes
0 answers
external symbol 'test' was defined but not referenced [CERT C Recommendation MSC12-C]
Facing not referenced issue for the function prototyping using pc-lint.
IDE : keil
external symbol 'test' was defined but not referenced [CERT C Recommendation MSC12-C]
714 Informational
The named external variable or external function was defined…

rock123A
- 82
- 2
- 11
0
votes
0 answers
PC-lint configuration for an arm target
I tried to follow the documentation ( PC-lint.pdf ) and update the option.int file by adding the following options.
-ecpu=cortexm4f -thumb -thumb_lib
--short.enum -align4 --no_commons
-no_alternative_tokens …

Ptns
- 11
- 2
0
votes
1 answer
PC-LINT error 5448: token is not a valid binary operator in a preprocessor subexpression
today I wanna try analyze my source code via PC-LINT.
I configured PC lint for my compiler - RL78. And it seems like it works.
Meanwhile I added more files to analyze, and then I noticed one strange error.
error: 5448: token is not a valid binary…

raptor
- 1
- 2
0
votes
0 answers
How to install pc-lint with AURIX IDE
My compiler:
TASKING for TriCore TC1796 V2.0R1:
TriCore v2.0 C Cross-Compiler, Assembler, Linker User's Guide, V1.2
I need to apply MISRA C on my code in AURIX IDE
0
votes
1 answer
PC-Lint with Azure Pipelines - Has anyone ever tried to configure PC-Lint with azure pipelines?
I have CCS and Visual studio projects build on azure pipelines. The CCS projects build from the command line using eclipse. I have tried PC-Lint on CCS but because of licensing and in an attempt to reduce the number of licenses needed to use PC-Lint…

Masuma Ismael
- 5
- 1
0
votes
1 answer
How could PC-lint ignore/suppress warnings from Google Protocol buffer headers?
I'm using the PC-lint on my project which uses the Google protocol buffer.
The PC-lint generates too many warnings related to xxx.pb.h.
Is there any configuration to set something like "header whitelist" to prevent this?
I know for clang-tidy, it…

kaixin liu
- 89
- 8
0
votes
1 answer
Evaluation of floats in if condition
I was debbugging some code and found an interesting if condition which was not marked as an error while using pc-lint with MISRA2004.
static float32_t float_values[10u] = {0.0f};
if (float_values[FIXED_ARRAY_ENTRY])
{
/* Do stuff */
}
I do see…

tryanderror
- 153
- 1
- 9
0
votes
1 answer
Why does PC-Lint complain about redeclaration (Error 18)?
Please note that the following code is pretty meaningless, I just wanted to reproduce an error that I am seeing in a much more complex codebase. Obviously, I would not create a variable with global scope to pass it to a function that is used in…

embedded_guy
- 1,939
- 3
- 24
- 39
0
votes
1 answer
Visual Studio CMake build log adds project path and breaks error parsing
I managed to set up PC-Lint as a custom target for my CMake project that is usable in Visual Studio 2019.
add_custom_target( PROJECT_LINT
COMMAND C:/pc_lint/Lint-nt +v -u project_opts.lnt ${PROJECT_SOURCE_FILES}
WORKING_DIRECTORY…

ThePMO
- 413
- 4
- 13
0
votes
1 answer
How do I resolve a issue related to IAR Embedded Workbench ARM library header file for successfully running PC-Lint in IAR?
When I run PC-Lint on my code on IAR Workbench it conflicts with a code snippet present in library header file yvals.h which I am including below and then PC-Lint stops working.
/* IAR compiler version check */
#if (__IAR_SYSTEMS_ICC__ < 9) ||…

Utkarsh
- 31
- 5
0
votes
1 answer
Dependence placed on C/C++ operator precedence; operators '&&' and '==' [MISRA 2012 Rule 12.1, advisory] | pclint 9050
uint8 config;
#define ELEM1 1U
void test1(void)
{
/*Check Bit 0 of Configuration*/
if((config) == 2 && (config) == 4)
{
arr[ELEM1].status[0] = 0x00;
}
}
do I need to try with
1)
if(((config) == 2) && ((config)…

kapilddit
- 1,729
- 4
- 26
- 51
0
votes
3 answers
declaration of const pointer vs declaration of const integer
Anyone can explain me what is the difference between two blocks of code below:
func1 (...)
{
int32_t index;
const int32_t *p;
p =& (index);
}
func2 (...)
{
const int32_t s;
s=10;
}
It is possible to declare a const pointer…

sara
- 7
- 1