<?xml version="1.0" encoding="UTF-8"?><resultsversion="2"><cppcheckversion="2.12 dev"/><errors><errorid="zerodivcond"severity="warning"msg="Either the condition '!x' is redundant or there is division by zero at line 2."verbose="Either the condition '!x' is redundant or there is division by zero at line 2."cwe="369"file0="1.c"><locationfile="1.c"line="2"column="8"info="Division by zero"/><locationfile="1.c"line="3"column="6"info="Assuming that condition '!x' is not redundant"/></error></errors></results>
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
hey can you guys please tell me the command on how to get this info parameter in the location
<location file="1.c" line="2" column="8" info="Division by zero">
<location file="1.c" line="3" column="6" info="Assuming that condition '!x' is not redundant">
</location></location>
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
$cat1.c
voidfoo(intx){
a=10/x;
if(!x){}
}
$./cppcheck--enable=warning--xml-q1.c
<?xml version="1.0" encoding="UTF-8"?><resultsversion="2"><cppcheckversion="2.17 dev"/><errors><errorid="zerodivcond"severity="warning"msg="Either the condition '!x' is redundant or there is division by zero at line 2."verbose="Either the condition '!x' is redundant or there is division by zero at line 2."cwe="369"file0="1.c"><locationfile="1.c"line="2"column="11"info="Division by zero"/><locationfile="1.c"line="3"column="9"info="Assuming that condition '!x' is not redundant"/></error></errors></results>
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello, I noticed that we don't see all finds from CPPCHeck in our CI because all lines of the category "note" don't appear in the XML file.
Is there a way to force all results to be written to the XML file?
I don't directly see how to reproduce it. What version do you use?
The notes should be reported as
<location>
elements as below:Example code:
textual output:
xml output:
That's right, the note data is available as location.
Sorry, I had misunderstood the XML struture.
Thanks for looking over it and sorry again.
hey can you guys please tell me the command on how to get this info parameter in the location
<location file="1.c" line="2" column="8" info="Division by zero">
<location file="1.c" line="3" column="6" info="Assuming that condition '!x' is not redundant">
</location></location>