congmomo / cppcheclipse

Automatically exported from code.google.com/p/cppcheclipse
0 stars 0 forks source link

Could not initialize cppcheck #15

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Install cppcheck application (into /usr/bin/cppcheck)
2. Install cppcheclipse
3. Configure plugin (set cppcheck path "/usr/bin/cppcheck"). Version in 
dialog will updated to 1.43
4. Select "Run cppcheck" from project context menu.

What is the expected output?
Expexted to recieve check result

What do you see instead?
I see:
org.eclipse.core.runtime.CoreException
with following details:
  Error checking myProject
  Could not initialize cppcheck
  Content is not allowed in trailing section.

What version of cppcheclipse, cppcheck and Eclipse are you using? On what
operating system?
cppcheclipse - 0.9.5.201002042253
cppcheck - 1.43
eclipse - 3.4.0
OS - Linux(openSuSe 11.2)

Please provide output of the console view for cppcheck as well as the
output of the Eclipse error.log
Executing '/usr/bin/cppcheck --version'
Cppcheck 1.43
Duration 218 ms.
Executing '/usr/bin/cppcheck --errorlist'
<?xml version="1.0"?>
<results><error id="autoVariables" severity="error" msg="Wrong assignment 
of an auto-variable to an effective parameter of a function"/>
<error id="returnLocalVariable" severity="error" msg="Returning pointer to 
local array variable"/>
<error id="returnReference" severity="error" msg="Returning reference to 
auto variable"/>
<error id="returnTempReference" severity="error" msg="Returning reference 
to temporary"/>
<error id="returnAutocstr" severity="error" msg="Returning pointer to auto 
variable"/>
<error id="returnTempPointer" severity="error" msg="Returning pointer to 
temporary"/>
<error id="arrayIndexOutOfBounds" severity="error" msg="Array index out of 
bounds"/>
<error id="bufferAccessOutOfBounds" severity="error" msg="Buffer access 
out-of-bounds: buffer"/>
<error id="strncatUsage" severity="style" msg="Dangerous usage of strncat. 
Tip: the 3rd parameter means maximum number of characters to append"/>
<error id="outOfBounds" severity="error" msg="index is out of bounds"/>
<error id="sizeArgumentAsChar" severity="style" msg="The size argument is 
given as a char constant"/>
<error id="terminateStrncpy" severity="style" msg="After a strncpy() the 
buffer should be zero-terminated"/>
<error id="negativeIndex" severity="error" msg="Array index -1 is out of 
bounds"/>
<error id="noConstructor" severity="style" msg="The class 'classname' has 
no constructor. Member variables not initialized."/>
<error id="uninitVar" severity="style" msg="Member variable not initialized 
in the constructor 'classname::varname'"/>
<error id="unusedPrivateFunction" severity="style" msg="Unused private 
function 'classname::funcname'"/>
<error id="memsetClass" severity="error" msg="Using 'memfunc' on class"/>
<error id="memsetStruct" severity="error" msg="Using 'memfunc' on struct 
that contains a 'std::classname'"/>
<error id="operatorEq" severity="style" msg="'operator=' should return 
something"/>
<error id="virtualDestructor" severity="error" msg="Class Base which is 
inherited by class Derived does not have a virtual destructor"/>
<error id="thisSubtraction" severity="style" msg="Suspicious pointer 
subtraction"/>
<error id="operatorEqRetRefThis" severity="style" msg="'operator=' should 
return reference to self"/>
<error id="functionConst" severity="style" msg="The function 
'class::function' can be const"/>
<error id="dangerousFunctionmktemp" severity="style" msg="Found 'mktemp'. 
You should use 'mkstemp' instead"/>
<error id="dangerousFunctiongets" severity="style" msg="Found 'gets'. You 
should use 'fgets' instead"/>
<error id="dangerousFunctionscanf" severity="style" msg="Found 'scanf'. You 
should use 'fgets' instead"/>
<error id="exceptThrowInDestructor" severity="style" msg="Throwing 
exception in destructor"/>
<error id="exceptNew" severity="style" msg="Upon exception there is memory 
leak: p"/>
<error id="exceptRealloc" severity="style" msg="Upon exception p becomes a 
dead pointer"/>
<error id="exceptDeallocThrow" severity="error" msg="Throwing exception in 
invalid state, p points at deallocated memory"/>
<error id="memleak" severity="error" msg="Memory leak: varname"/>
<error id="resourceLeak" severity="error" msg="Resource leak: varname"/>
<error id="deallocDealloc" severity="error" msg="Deallocating a deallocated 
pointer: varname"/>
<error id="deallocuse" severity="error" msg="Dereferencing 'varname' after 
it is deallocated / released"/>
<error id="mismatchSize" severity="error" msg="The given size sz is 
mismatching"/>
<error id="mismatchAllocDealloc" severity="error" msg="Mismatching 
allocation and deallocation: varname"/>
<error id="sprintfOverlappingData" severity="error" msg="Undefined 
behaviour: varname is used wrong in call to sprintf or snprintf. Quote: If 
copying takes place between objects that overlap as a result of a call to 
sprintf() or snprintf(), the results are undefined."/>
<error id="udivError" severity="error" msg="Unsigned division. The result 
will be wrong."/>
<error id="nullPointer" severity="error" msg="Possible null pointer 
dereference: pointer"/>
<error id="uninitstring" severity="error" msg="Dangerous usage of 'varname' 
(strncpy doesn't always 0-terminate it)"/>
<error id="uninitdata" severity="error" msg="Data is allocated but not 
initialized: varname"/>
<error id="uninitvar" severity="error" msg="Uninitialized variable: 
varname"/>
<error id="zerodiv" severity="error" msg="Division by zero"/>
<error id="wrongmathcall" severity="error" msg="Passing value  to () leads 
to undefined result"/>
<error id="fflushOnInputStream" severity="error" msg="fflush() called on 
input stream &quot;stdin&quot; may result in undefined behaviour"/>
<error id="cstyleCast" severity="style" msg="C-style pointer casting"/>
<error id="redundantIfDelete0" severity="style" msg="Redundant condition. 
It is safe to deallocate a NULL pointer"/>
<error id="redundantIfRemove" severity="style" msg="Redundant condition. 
The remove function in the STL will not do anything if element doesn't 
exist"/>
<error id="dangerousUsageStrtol" severity="error" msg="Invalid radix in 
call to strtol or strtoul. Must be 0 or 2-36"/>
<error id="unusedStructMember" severity="style" msg="struct or union member 
'structname::variable' is never used"/>
<error id="passedByValue" severity="style" msg="Function parameter 
'parametername' is passed by value. It could be passed by reference 
instead."/>
<error id="constStatement" severity="style" msg="Redundant code: Found a 
statement that begins with type constant"/>
<error id="charArrayIndex" severity="style" msg="Warning - using char 
variable as array index"/>
<error id="charBitOp" severity="style" msg="Warning - using char variable 
in bit operation"/>
<error id="variableScope" severity="style" msg="The scope of the variable 
varname can be reduced"/>
<error id="conditionAlwaysTrueFalse" severity="style" msg="Condition is 
always true/false"/>
<error id="strPlusChar" severity="error" msg="Unusual pointer arithmetic"/>
<error id="emptyStringTest" severity="style" msg="Empty string test can be 
simplified to &quot;*varname == '\0'&quot;"/>
<error id="invalidIterator" severity="error" msg="Invalid iterator: 
iterator"/>
<error id="iterators" severity="error" msg="Same iterator is used with both 
container1 and container2"/>
<error id="mismatchingContainers" severity="error" msg="mismatching 
containers"/>
<error id="eraseDereference" severity="error" msg="Dereferenced iterator 
'iter' has been erased"/>
<error id="stlOutOfBounds" severity="error" msg="When i==foo.size(), foo[i] 
is out of bounds"/>
<error id="erase" severity="error" msg="Dangerous iterator usage. After 
erase the iterator is invalid so dereferencing it or comparing it with 
another iterator is invalid."/>
<error id="invalidIterator" severity="error" msg="After 
push_back|push_front|insert, the iterator 'iterator' may be invalid"/>
<error id="invalidPointer" severity="error" msg="Invalid pointer 'pointer' 
after push_back / push_front"/>
<error id="stlBoundries" severity="error" msg="container range check should 
use != and not &lt; since the order of the pointers isn't guaranteed"/>
<error id="stlIfFind" severity="style" msg="Suspicious condition. The 
result of find is an iterator, but it is not properly checked."/>
<error id="stlIfStrFind" severity="style" msg="Suspicious condition. 
string::find will return 0 if the string is found at position 0. If this is 
what you want to check then string::compare is a faster alternative because 
it doesn't scan through the string."/>
<error id="unusedFunction" severity="style" msg="The function 'funcName' is 
never used"/>
<error id="syntaxError" severity="error" msg="Invalid number of character ( 
) when these macros are defined: ''."/>
<error id="cppcheckError" severity="error" msg="### Internal error in 
Cppcheck. Please report it."/>
</results>
cppcheck: No C or C++ source files found.
Duration 205 ms.

Original issue reported on code.google.com by grey...@gmail.com on 14 May 2010 at 2:13

GoogleCodeExporter commented 9 years ago
This is due to bug 1318 in cppcheck 1.43
(http://sourceforge.net/apps/trac/cppcheck/ticket/1318). However version 0.96 
will
have a workaround implemented. Till cppcheclipse 0.96 is released, either use
cppcheck 1.42 or the latest version of cppcheck from git where the bug is fixed 
since
yesterday.

Original comment by konra...@gmx.de on 14 May 2010 at 2:18

GoogleCodeExporter commented 9 years ago
A lot of thanks. Workaround with 1.42 works good for me. Thanks again

Original comment by grey...@gmail.com on 14 May 2010 at 2:28

GoogleCodeExporter commented 9 years ago

Original comment by konra...@gmx.de on 15 May 2010 at 6:25

GoogleCodeExporter commented 9 years ago

Original comment by konra...@gmx.de on 16 May 2010 at 11:50