Bug 42781 - fix windows build warnings ...
Summary: fix windows build warnings ...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:4.1.0
Keywords: difficultyBeginner, easyHack, skillCpp, topicCleanup
Depends on:
Blocks:
 
Reported: 2011-11-10 04:00 UTC by Michael Meeks
Modified: 2015-12-15 23:56 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Meeks 2011-11-10 04:00:04 UTC
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
Comment 1 Michael Meeks 2011-11-10 04:01:36 UTC
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´
Comment 2 Don't use this account, use tml@iki.fi 2011-11-16 03:36:11 UTC
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.
Comment 3 Florian Reisinger 2012-05-18 09:12:32 UTC
Deteted "Easyhack" from summary
Comment 4 Thomas Arnhold 2013-03-06 02:00:09 UTC
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\}'
Comment 5 Thomas Arnhold 2013-03-06 03:37:37 UTC
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
Comment 6 Commit Notification 2013-03-27 10:15:20 UTC
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.
Comment 7 Michael Meeks 2013-04-02 14:52:37 UTC
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.
Comment 8 Petr Kraus 2013-04-04 18:24:22 UTC
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.
Comment 9 Commit Notification 2013-04-04 21:04:34 UTC
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.
Comment 10 Commit Notification 2013-04-19 11:20:58 UTC
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.
Comment 11 Robinson Tryon (qubit) 2015-12-15 23:56:10 UTC
Migrating Whiteboard tags to Keywords: (EasyHack,DifficultyBeginner,SkillCpp,TopicCleanup)
[NinjaEdit]