Cppcheck: 'TimeBuffer' is not assigned a value in basic module
julien2412
serval2412 at yahoo.fr
Tue Feb 12 01:00:36 PST 2013
Hello,
Cppcheck reported this:
basic/source/comp/sbcomp.cxx
600 unassignedVariable style Variable 'TimeBuffer' is not assigned a value.
Here are the lines:
600 char TimeBuffer[200];
601 #ifdef DBG_TRACE_PROFILING
602 if( bPrintTimeStamp )
603 {
604 double dDiffTime = dCurTime - GdLastTime;
605 GdLastTime = dCurTime;
606 sprintf( TimeBuffer, "\t\t// Time = %f ms / += %f ms",
dCurTime*1000.0, dDiffTime*1000.0 );
607 }
608 #endif
609
610 if( bSTMT )
611 {
612 lcl_lineOut( rStr_STMNT.getStr(), lcl_getSpaces( nIndent ),
613 (bPrintTimeStamp && !GbIncludePCodes) ?
TimeBuffer : NULL );
614 }
See
http://opengrok.libreoffice.org/xref/core/basic/source/comp/sbcomp.cxx#600
By taking a look at the file, I notice there was 1 #ifdef DBG_TRACE_BASIC
and several blocks of #ifdef DBG_TRACE_PROFILING. Is it really useful to
keep both? What about removing DBG_TRACE_PROFILING and considering that
DBG_TRACE_BASIC should enable all debug (Basic + profiling) ?
If not, what should be done about TimeBuffer variable?
Julien
--
View this message in context: http://nabble.documentfoundation.org/Cppcheck-TimeBuffer-is-not-assigned-a-value-in-basic-module-tp4036591.html
Sent from the Dev mailing list archive at Nabble.com.
More information about the LibreOffice
mailing list