While we build without warnings quite nicely on Linux and Mac, the windows build using MSVC++ provides different warnings, some of which point to real bugs. It would be lovely if we could get to a warning-free windows build. The tinderboxen are shown at: http://tinderbox.libreoffice.org/MASTER/status.html The Voreppe Win32 tinderbox is a MSVC++ one, and the full log can be downloaded by clicking on the 'L' entry in the relevant popup. Some warnings eg. patching file STLport-4.5-0119/stlport/stl/debug/_debug.c 988 C:/PROGRA~1/MICROS~2/Windows/v7.1/include\basetsd.h(434) : warning C4005: ´MAXUINT32´ : macro redefinition 989 d:\master\lpsolve\wntmsci12.pro\misc\build\lp_solve_5.5\lp_types.h(51) : see previous definition of ´MAXUINT32´ Are not easy to fix, and should be left until last: this is a conflict between two 'external' modules (ie. included as source archives) - STLport and lp_solve. You can see 'external' modules fairly easily since they build in a path like this: d:/master/nss/wntmsci12.pro/misc/build/nss-3.12.8/ ie. in a misc/build - sub-directory. They are normally at the beginning. So - working from the end of the log up-wards is prolly the best strategy: eg. 19979 Compiling: redland/wntmsci12.pro/misc/build/redland-1.0.8/librdf/rdf_stream.c 19980 19981 rdf_stream.c(107) : warning C4100: ´user_data´ : unreferenced formal parameter 19982 rdf_stream.c(584) : warning C4100: ´stream´ : unreferenced formal parameter
drat my example was really bad - also an external module; sadly that tinderbox failed before it got to any core core ;-) A better one is: 27410 d:/master/basebmp/inc\basebmp/bitmapdevice.hxx(67) : warning C4099: ´basebmp::IBitmapDeviceDamageTracker´ : type name first seen using ´class´ now seen using ´struct´ 27411 d:/master/basebmp/inc\basebmp/bitmapdevice.hxx(59) : see declaration of ´basebmp::IBitmapDeviceDamageTracker´
Looking through git log for commits by me during this year with the commit message starting with "WaE:" one can find many examples of MSVC warnings being removed. For some classes of warnings, though, there were so many occurrences, or they were so tedious to fix, or pointless, that I added the warning number to the list of ignored warnings... (the list of -wd options passed to the MSVC compiler, in solenv/inc/wntmsc.mk and solenv/gbuild/platform/WNT_INTEL_MSC.mk). A subtask of this Easy Hack would be to check the list of MSVC warnings that have been disabled for a long time, and see if we are disabling some warnings that we actually wouldn't see many of and that would be easy to fix, and/or where the warning is useful.
Deteted "Easyhack" from summary
Another aspect of this are disabled warnings in the code. Those need a review, too. To get them all: git grep "#pragma" | grep '[0-9]\{4\}'
To review the warning options set in the code use this one-liner to remove all code based changes to the warning options: for i in `git grep '#pragma warning' | cut -d ':' -f1 | sort -u`; do sed -i '/#pragma warning\w*(\w*\(disable\|push\|pop\).*/d' $i; done
Petr Kraus committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=00e9accbc591791b6529105807a2944cd92dde78 fdo#42781 WaE: unreachable code The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
It appears that all the remaining warnings come either from auto-generated lex code, or modules outside our control - which is lovely. Thanks for all the fixes.
Found one more warning. Now i get only external ones too(maybe they should be compiled with warnings disabled where possible)... Not sure about the C4530: "exception handler used, but unwind semantics are not enabled. Specify /EHsc". It just seems to want different compiler argument. What I understood from MSDN library, it can even leak some memory without it.
Petr Kraus committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=f5928f09ad53de2c4683000619d29be140a97be8 fdo#42781 WaE: C4101 unreferenced local variable The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Petr Kraus committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=8dd4db783ffe5a11b5bf427014a2f8524cc87cad fdo#42781 Do not unnecessarily ignore MSVC warnings The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Migrating Whiteboard tags to Keywords: (EasyHack,DifficultyBeginner,SkillCpp,TopicCleanup) [NinjaEdit]