Questions tagged [cppcheck]

Cppcheck is an open source tool for static C/C++ code analysis that tries to detect bugs that a C/C++ compiler doesn't see.

Cppcheck - A tool for static C/C++ code analysis

Cppcheck is an analysis tool for C/C++ code. Unlike C/C++ compilers and many other analysis tools, we don't detect syntax errors. Cppcheck only detects the types of bugs that the compilers normally fail to detect. The goal is no false positives.

389 questions
0
votes
1 answer

Cppcheck into Jenkins with QT project

I have server with Jenkins and QT project. The server runs on CentOS 7. I installed "Cppcheck" into server also I installed "Cppcheck Plug-in" plugin into Jenkins. The script for build project: cd FlashClipboard; /usr/lib64/qt5/bin/qmake…
nik3212
  • 392
  • 1
  • 6
  • 18
0
votes
1 answer

How to save different Cppcheck results in a same Xml file

I am already doing cppcheck path.c --xml-version=2 2> path2.xml. the thing is that i want to do several cppchecks in different files but I want to sabe then in a single xml file is possible. I do not know if this has lot of sense, because maybe you…
0
votes
1 answer

C: Cppcheck : Possible null point dereference

So here in main.c, ive got this part of code that prints the content of encrypted if its not empty. Its really simple as that. The cpp error is: [main.c:40]: (error) Possible null pointer dereference: encrypted - otherwise it is redundant to…
Mathue24
  • 152
  • 1
  • 2
  • 8
0
votes
1 answer

configuration of cppcheck linter in sublime text 3

I installed the cppcheck in my machine and Sublimelinter & cppcheck plugin in my SublimeText3 as the documentation says but I am still unable to get the cppcheck working. I think I am doing some mistake in the path variable. I read this answer but…
Sunil Kumar
  • 390
  • 1
  • 7
  • 25
0
votes
2 answers

How to get cppcheck-results into SonarQube

We use cpp-check and SonarQube 6.0 and want to inject the results of cppcheck into the system. Cppcheck runs fine and produces an xml-file with results. However Cpp-check and SonarQube are not running on the same machine. Is it sufficient to set…
user2656732
0
votes
1 answer

How to resolve the Issue ID "toomanyconfigs" and "missingInclude:" in Cppcheck

I am working in an MFC application (around 2000 files) with Visual Studio 2008. I run Cppcheck for this application, but I found these two issues. Issue toomanyconfigs: (Information -- The checking of the file will be interrupted because there are…
Suman Reddy
  • 91
  • 1
  • 13
0
votes
1 answer

Publishing a "permanent" cppcheck report

By default, Jenkins associates a cppcheck report with a particular build (which makes sense). The problem is, if the number of builds to save is limited, then the link to the report for that build will become invalid when the build gets deleted. Is…
David Doria
  • 9,873
  • 17
  • 85
  • 147
0
votes
1 answer

c++ community manager sonar plugin failing to parse cppcheck report

I am trying to parse cppcheck report in sonar using c++ community plugin. I got the following error INFO - Sensor CxxCppCheckSensor DEBUG - Normalized report includes to '[C:\Program Files (x86)\Jenkins\workspace\IHM TR\cppCheckTmp.xml]' DEBUG -…
Flows
  • 3,675
  • 3
  • 28
  • 52
0
votes
0 answers

Why does Cppcheck not detect the following format string vulnerable code?

like the following code, it is obvious fmt string vulnerability: void log(char* str) { printf(str); } if can detect with self-defined config, how can I detect this vulnerability with CppCheck?
0
votes
0 answers

Understading cppcheck warning and errors?

I was trying to understanding check list of warning/error thrown by cppcheck from https://sourceforge.net/p/cppcheck/wiki/ListOfChecks/ I come across following warning in auto section :- suspicious assignment of pointer argument. useless assignment…
Pradeep Goswami
  • 1,785
  • 1
  • 15
  • 24
0
votes
2 answers

Difference between *f and (*f) in C?

CppCheck (v1.72) says there is a difference when using (*f) or just *f. The this case void test(float *f) { float a = 0.0f; if(*f>a) { (*f) += 0.01f; if(*f
floquet22
  • 323
  • 2
  • 15
0
votes
0 answers

How to add rule for Cppcheck in Vim

I have one issue with Cppcheck during enable it in Vim, for normal code it works fine but normally I have typedef and some functions which may not known by Cppcheck. For individual check, I have no problem because I can write library and rules for…
How Chen
  • 1,340
  • 2
  • 17
  • 37
0
votes
1 answer

Sonar runner is not listing the CxxCppCheckSensor while runner is started

I am new to sonar, i have installed sonarqube on RHEL 7 machine and its version is 5.1.1. and the runner's version is 2.4. I have four cpp related plugins, i tried with each one, sonar-cxx-plugin-0.9.4-RC3.jar…
Dinesh
  • 21
  • 2
0
votes
1 answer

cppcheck finding "redundant code: found a statement that begins with numeric constant" for macro

We're trying to do static analysis using cppcheck for our code base for linux using the jenkins plugin. For some reason, it's finding numerous errors for the following type of thing: CREATE_DERIVED_EXCEPTION_CLASS(ExceptionOSApiError, 5) and also…
Michele
  • 3,617
  • 12
  • 47
  • 81
0
votes
1 answer

Listing possible null dereference or forward null in CPP source code

Is there a tool which can do static analysis and find possible forward null and possible null dereference cases. I know coverity is pretty much used and also cpp check. But I dnt find it usefull when comes to user defined data-type comes to…