Closed GoogleCodeExporter closed 9 years ago
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 konra...@gmx.de
on 4 Feb 2010 at 4:06
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 jpe...@micros-retail.com
on 4 Feb 2010 at 5:47
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 konra...@gmx.de
on 4 Feb 2010 at 7:51
Original comment by konra...@gmx.de
on 4 Feb 2010 at 9:28
Thanks for the fix.
Original comment by jpe...@micros-retail.com
on 5 Feb 2010 at 6:23
Original issue reported on code.google.com by
jpe...@micros-retail.com
on 4 Feb 2010 at 4:00