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

How to supress output from library code in cppcheck?

Running cppcheck on my project gives me about 80% ouput about library files instead of my code. Is there a way to tell cppcheck to only search library(-headers) for definitions and such but not actually perform checks? Or at least to supress the…
Chaos_99
  • 2,284
  • 2
  • 25
  • 29
0
votes
1 answer

Changing cppcheck alloc/free functions names

I've a source code that was written with wrappers to dynamic memory allocation. something like: wrapper_free(void *ptr); wrapper_malloc(size_t size); this was done to ensure portability, and as the code is third-party the problem is to fix the bugs…
Cristiano Araujo
  • 1,632
  • 2
  • 21
  • 32
0
votes
1 answer

CPPCheck returns inconsistent results

I've set up CPPCheck (v1.6.1) for a large project containing a bunch of libraries. When I check a library then I get some check failures which I'm interested in and all is well. However at this point I just have a text file list of all the *.cpp and…
steeveeet
  • 639
  • 6
  • 25
0
votes
1 answer

Sublime Text 3: SublimeLinter: c disabled ("cppcheck" cannot be found)

Hello I'm still getting this error: SublimeLinter: c disabled ("cppcheck" cannot be found) even if I tried to install Google cpplint. Here are my User settings: { "sublimelinter": "save-only", "sublimelinter_syntax_map": { "Python Django":…
Nenor
  • 33
  • 2
  • 6
0
votes
1 answer

Got "Missing separator" error building Cppcheck

I have trouble building Cppcheck in Windows. It's ok while building in Studio, but when I try build.bat, it fails with the following: Makefile.Release:148: *** missing separator. Stop. mingw32-make: *** [release] Error 2 I'm not good with all the…
akalenuk
  • 3,815
  • 4
  • 34
  • 56
0
votes
1 answer

Cppcheck Jenkins plugin not expanding variables

I have a Jenkins job that creates a cppcheck XML report. I need to publish this report into Jenkins. This works: This does NOT work: So it seems to me that Jenkins is not correctly expanding environment variables in that specific case. Any idea…
Korchkidu
  • 4,908
  • 8
  • 49
  • 69
0
votes
0 answers

CPPCHECK unusedFunction when a function is const

I have a simple class with a few const memeber functions and am running through CPPCHECK with the following parametes cppcheck.exe --includes-file=.\Modules\ --enable=all .\Modules\ --xml 2> .\StaticQuality\error.xml As you can see I am only…
NiladriBose
  • 1,849
  • 2
  • 16
  • 31
0
votes
1 answer

Disable SublimeLinter for a large C file in a C++ project

I have a C++ project with one very large C file (the excellent lightweight mongoose web server) which really canes cppcheck. Is there a way to disable the automatic lint for this file alone? Or failing that, how can I switch off automatic linting…
Rob Agar
  • 12,337
  • 5
  • 48
  • 63
0
votes
0 answers

how git get the cppcheck report

Firstly, Cppcheck checks code will come out a result which stored in a file. In Git, the file is in everyone's local computer because Git is a distributed system, Now we want to collect the files and analyze the files. But we don't know how to…
0
votes
1 answer

Can we add/remove coding standards to CppCheck?

Can we add some of the coding standards which is not defined in Cppheck, or can we remove some of the coding standards defined in Cpppcheck which i does not want to check.
Dinesh Kumar
  • 141
  • 10
-1
votes
1 answer

How to use cppcheck-suppress command to elimnate the error about "a parameter should be passed by reference"

In function "writeFile" below it has the following signature: writeFile(std::string fileId, std::string otherVariable){} when I run it, an error: Function parameter 'aFileId' should be passed by const reference. [passedByValue] is recieved.…
moab
  • 31
  • 6
-1
votes
1 answer

cppcheck Non-local variable 'xxx' will use pointer to local variable 'config'

This is my code.I'm use cppcheck check my code,error log display Non-local variable 'm_curServer' will use pointer to local variable 'config'. I am a novice.I don't know what to do about it.I hope to get your help. thanks!
-1
votes
2 answers

do-while in fibonacci sequence repeating answer

I made a program about Fibonacci program. I would like to repeat the program so I used do-while loop. However, it seems like the last two numbers from the previous result keep coming. It is supposed to reset back to the first term. Please help me…
newbie
  • 3
  • 2
-1
votes
1 answer

cppcheck: No C or C++ source files found even though file is present in directory?

I receive the cppcheck: No C or C++ source files found. error even though the file in question is present in the directory I am searching in. This is the command I am running: subprocess.call('cppcheck --dump --max-ctu-depth=0' + cpp_file_path,…
-1
votes
1 answer

CPP Guessing Game not working, its stops after i enter the name

I'm trying to make this kina guess game on C++, I'm a beginner and still learning. What I'm trying to achieve is a guessing game of two const names, is very simple without errors but it's not working after I enter something. it should report until I…
user15164743
1 2 3
25
26