Coder Social home page Coder Social logo

Comments (5)

GoogleCodeExporter avatar GoogleCodeExporter commented on August 27, 2024
To help me resolve that issue, please provide further information. 
1. What is the output you see in console, when running cppcheck. 
2. Are there any errors in the error.log? 
3. Could you attach a sample source which produces issues with cppcheck GUI but 
not
with cppcheclipse.

Original comment by [email protected] on 4 Feb 2010 at 4:06

from cppcheclipse.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 27, 2024
The source code doesn't matter. For a quick test, the following will do

int main()
{
    char a;
    char b = 0;
    char c[10];
    char *d = 0;

    strcpy(d, "something"); // Produces error

    a = c[b]; // Produces warning
}

The Java console shows: 
Executing '"C:\Program Files\Cppcheck\cppcheck.exe" --xml --enable=all  
C:\junk.cpp'
<?xml version="1.0"?>
Checking C:\junk.cpp...
<results>
<error file="C:\junk.cpp" line="10" id="nullPointer" severity="error" 
msg="Possible
null pointer dereference: d"/>
</results>
Duration 125 ms.

However, running the same command in a DOS command prompt will yield something 
different.

c:\projects>"C:\Program Files\Cppcheck\cppcheck.exe" --xml --enable=all  
C:\junk.cpp
<?xml version="1.0"?>
<results>
Checking C:\junk.cpp...
<error file="C:\junk.cpp" line="12" id="charArrayIndex" severity="style" 
msg="Warning
- using char
 variable as array index"/>
<error file="C:\junk.cpp" line="10" id="nullPointer" severity="error" 
msg="Possible
null pointer d
ereference: d"/>
Checking usage of global functions..
</results>

Original comment by [email protected] on 4 Feb 2010 at 5:47

from cppcheclipse.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 27, 2024
Thanks for that example, I could now reproduce it. This is caused by how the 
command
line arguments are given to cppcheck with Java. There were some spaces too much,
which lead to some options not being recognized by cppcheck. In your example, 
only
the --xml was evaluated by cppcheck, but not the --enable=all. 
After spotting that bug, I will try to upload a new version as soon as possible.

Original comment by [email protected] on 4 Feb 2010 at 7:51

  • Changed title: Command line arguments not correctly transmitted to cppcheck
  • Changed state: Started

from cppcheclipse.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 27, 2024

Original comment by [email protected] on 4 Feb 2010 at 9:28

  • Changed state: Verified
  • Added labels: Milestone-0.9.5

from cppcheclipse.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 27, 2024
Thanks for the fix.

Original comment by [email protected] on 5 Feb 2010 at 6:23

from cppcheclipse.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.