Cppcheck : Variable 'nMode' is reassigned in fstat.cxx

julien2412 serval2412 at yahoo.fr
Sat Jan 19 08:35:58 PST 2013


Hello,

Cppcheck reported this: 
<error file="tools/source/fsys/fstat.cxx" line="112"
id="redundantAssignment" severity="style" msg="Variable 'nMode' is
reassigned a value before the old one has been used."/>
<error file="tools/source/fsys/fstat.cxx" line="113"
id="redundantAssignment" severity="style" msg="Variable 'nMode' is
reassigned a value before the old one has been used."/>

Indeed, we can see this:
    109     if (bRO)
    110     {
    111         nMode = aBuf.st_mode & ~S_IWUSR;
    112         nMode = aBuf.st_mode & ~S_IWGRP;
    113         nMode = aBuf.st_mode & ~S_IWOTH;
    114     }

see
http://opengrok.libreoffice.org/xref/core/tools/source/fsys/fstat.cxx#109

Any idea about this?

Julien



--
View this message in context: http://nabble.documentfoundation.org/Cppcheck-Variable-nMode-is-reassigned-in-fstat-cxx-tp4030405.html
Sent from the Dev mailing list archive at Nabble.com.


More information about the LibreOffice mailing list