Hello,
as I said, still in warm up phase and getting back familiar with C++..
So cleaning is a good exercise.
I got a compiler warning:
filters/binfilter/bf_sw/source/core/para/sw_paratr.cxx:214:26: warning:
'nTemp' may be used uninitialized in this function
for this:
case MID_DROPCAP_LINES :
{
sal_Int8 nTemp;
rVal >>= nTemp;
if(nTemp >=1 && nTemp < 0x7f
nLines = (BYTE)nTemp;
}
Well, that's fine for me, nTemp is effectively not initialized. And the
second line is then the same as: rVal = rVal >> nTemp
In my understanding, since nTemps is not initialized, if the compiler is
nice, nTemp is then defaulted to 0 (or NULL). Then rVal = rVal >> 0 make
not a lot of sense and is a true nop (no operation). And if the compiler
is not nice, I do not know which value has nTemp, i could almost use
random... So for me it seems the two first lines are not needed and even
dangerous.
OK, now the question: what did I missed ?????
Thank for your help
regards
Context
- [Libreoffice] warnig and coding, need a little help on C++ · Pierre-André Jacquod
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.