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
2 answers

CppCheck does not detect memory leak

Have following code, but CppCheck(1.68) detects only "style" error. AbstractTelegram *TelegramFactory::CreateGetWigWagParameterTelegram(BYTE Address_i, BYTE SubAddress_i, BYTE Tag_i) { SignDataWigWag *pWigWag = new SignDataWigWag(); …
blackhearted
  • 37
  • 2
  • 5
0
votes
1 answer

How do I create rules for CPPCHECK

I have created the following rule file for cpp check: virtual .* \( .*dword .* \) virtual function Possible error This rule is…
Aswin Mc
  • 1
  • 1
0
votes
1 answer

build cppcheck 1.69 on Ubuntu 11.04 fails

I'm trying to build cppcheck 1.69 on Ubuntu 11.04. Command: make or make SRCDIR=build CFGDIR=cfg HAVE_RULES=yes Result: build/checkautovariables.cpp:527:16: error: no match for ‘operator==’ in ‘var == cppcheck_nullptr_impl’
0
votes
0 answers

How to join several xml files and convert to html

I have probably 20 different .xml files and I want to join them into a single file that contains the contents of these 20 files. Afterwards I want to convert this new file to .html and update it to Jenkins. Right now I'm also converting these 20…
Adrianeo
  • 131
  • 2
  • 9
0
votes
1 answer

Issue running Cppcheck with exec() command in PHP

I am designing a web application which uploads code from server and runs cppcheck on it. I am using PHP for the same. I tried using exec($command,$output,$status); command and command is "cppcheck ". $filename; The $output array which is returned…
Ruchi Tengse
  • 87
  • 1
  • 7
0
votes
2 answers

jenkins : cppcheck not running

I am trying to launch cppcheck for my tepp project under jenkins environment, system is win7-x64: I installed cppcheck.exe under C:\Program Files (x86)\Jenkins\cppcheck Jenkins config, shell exec path is : C:\Windows\system32\cmd.exe As…
norisknofun
  • 859
  • 1
  • 8
  • 24
0
votes
2 answers

Cppcheck can't check the third parameters?

Here is my .cfg
Zerochs
  • 3
  • 3
0
votes
0 answers

cppcheck issue publishing results

I face the below issue at the end of analysis while running the cppcheck for my code.. '/tmp/workspace/project'. Did you enter a pattern relative to the correct directory? Did you generate the XML report(s) for Cppcheck? [Cppcheck] Parsing…
satishkumar432
  • 337
  • 1
  • 6
  • 19
0
votes
0 answers

automate running cppcheck in tfs builds

I want to make cppcheck a part of the build process for tfs builds. Is adding a command to the prebuild script the only way to run it? I am using PowerShell scripts and I added the line: Start-Process -FilePath 'C:\Program Files…
wanda
  • 61
  • 1
  • 1
  • 7
0
votes
2 answers

Issue while passing pointer to constant as an argument

In this eg,using call by address concept in order to retrieve all the data changes which is happening in the function call... In main(), i)passing two arguments i)int pointer ii)pointer to constant -> which cannot change the value…
0
votes
1 answer

SonarQube showing issues but 0 days technical debt

I'm using Cppcheck to run analysis on my C++ project and then loading the results into SonarQube. SonarQube is showing the issues, but the technical debt shows 0. How can I get the technical debt to show up correctly? I'm running Cppcheck with this…
Tim
  • 1,276
  • 11
  • 23
0
votes
1 answer

"The buffer is accessed out of bounds" is reported by cppcheck

The static code analysis tool cppcheck reported a severe error in the code below: I don't know what is the problem. #define NUM_UPDATE_COUNT 3 #define MAX_NUM_CH_1LINE 27 wchar_t m_cCnt_Buf[NUM_UPDATE_COUNT][MAX_NUM_CH_1LINE]; …
canon
  • 1
0
votes
1 answer

Data loss issue while converting the string from std::string to const char *

In this function, passing string as an argument (which is having the huge amount of data as a string)... SendBytes method is defined like this bool NetOutputBuffer_c::SendBytes ( const void * pBuf, int iLen ) { BYTE * pMy = (BYTE*)pBuf; …
0
votes
1 answer

Checking non-standard file extensions with Cppcheck

Is there a way to pass custom file extensions to Cppcheck? For example, *.pc.
James
  • 65
  • 1
  • 5
0
votes
1 answer

any performance recommendations for cpp check visual studio plugin?

I have just recently installed cppcheck which had some pretty good recommendations for static analysis of c++ code online. cppcheck is installed properly and I can run it successfully from command line or the gui. I then installed the Visual Studio…
Robyn Fry
  • 83
  • 7