Cppcheck reports "Uninitialized variable bIsRow" in formulaparser.cxx
julien2412
serval2412 at yahoo.fr
Sun Mar 18 02:41:51 PDT 2012
Hello,
Cppcheck reports this :
[source/filter/oox/formulaparser.cxx:2611]: (error) Uninitialized variable:
bIsRow
Here are the lines :
2608 bool BiffFormulaParserImpl::readNlrSAddrAddData( BiffNlr& orNlr,
BiffInputStream& rStrm, bool bRow )
2609 {
2610 bool bIsRow;
2611 return readNlrSRangeAddData( orNlr, bIsRow, rStrm ) && (bIsRow
== bRow);
2612 }
Now the function called is just the lines after :
bool BiffFormulaParserImpl::readNlrSRangeAddData( BiffNlr& orNlr, bool&
orbIsRow, BiffInputStream& rStrm )
Ok, so orbIsRow must be initialized on this function. The pb is it isn't
always the case.
Moreover "readNlrSRangeAddData" is called by 2 functions :
- BiffFormulaParserImpl::importNlrSRangeToken
- BiffFormulaParserImpl::readNlrSAddrAddData
Now the question, should the boolean variables be initialized by the 2
calling functions, if yes at which value ?
Or should there be a default value (which one ?) on readNlrSRangeAddData ?
Julien.
--
View this message in context: http://nabble.documentfoundation.org/Cppcheck-reports-Uninitialized-variable-bIsRow-in-formulaparser-cxx-tp3836234p3836234.html
Sent from the Dev mailing list archive at Nabble.com.
More information about the LibreOffice
mailing list