Warnings at compile-time in GCC 4.8

Bug #1159432 reported by Hans Joachim Desserud on 2013-03-24
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Low
Unassigned

Bug Description

As some of you might know, GCC 4.8 was released recently (http://gcc.gnu.org/gcc-4.8/changes.html). Therefore, the only logical thing to do was to compile WL with it and see what happened. This was done on a Debian Sid system (though gcc-4.8 is still in experimental so you need to add that repository).

The main change warning-wise seems to be that it warns about -Wunused-local-typedefs now. This seems to boil down to the macro in src/compile_assert.h which based on the comment in it is done that way to avoid shadow warnings. So I guess we should decide whether this code can be improved or whether we want to ignore the warning. (We have the macros to temporarily disable warnings, but I am not sure whether it would be sufficient to apply it in src/compile_assert.h or if we would need to sprinkle it across all places referring to it.)

I only skimmed the rest of the warnings, but they seem to mostly be the same as we get in older releases too.

PS. I filed this as a new bug since I consider bug 825957 as fixed when we became warning-free. After bug 1033615 we are no longer warning-free again, though I think it is better to split out the discussion for these warnings. Otherwise we will end up with a gigantic bug report covering everything which has been closed and reopened multiple times as warnings are removed and introduced.

PPS. See bug 1202101 for warnings generated in Visual Studio.

Related branches

Hans Joachim Desserud (hjd) wrote :
SirVer (sirver) wrote :

I vote for ignoring - c++11 comes with static_assert which replaces this compile time assert. Once we switch (which we will soonish - c++ 11 is adopted at a fast pace) this warning will go away as well.

Hans Joachim Desserud (hjd) wrote :

GCC 4.8.1 has been released, though at a glance looks like just the same as in the previous warnings report...

Changed in widelands:
status: New → Triaged
description: updated
SirVer (sirver) wrote :

Btw, the killer feature here will be -fsanitize=address. This will be very useful to us.

SirVer (sirver) wrote :

I got annoyed by not having unique_ptr, so I took a stab at a gentle introduction of c++11 into the code base. proposed for merging.

SirVer (sirver) on 2013-07-21
Changed in widelands:
status: Triaged → Fix Committed
milestone: none → build18-rc1
Hans Joachim Desserud (hjd) wrote :

Sorry for being a spoilsport here, but while introducing c++11 fixed the majority of the issues, we still have one file which contains warnings.

Changed in widelands:
status: Fix Committed → Triaged
SirVer (sirver) wrote :

Those warnings are not new to gcc 4.8 though. They are also harmless (in this file) and might go away when we merge the spritemap branch - which will happen before b18. So they are won't fix for me - your call what this bug report is then, won't fix or fix committed :).

Hans Joachim Desserud (hjd) wrote :

Ah. Ok, if we're only counting new ones introduced with 4.8, then I guess it is fixed.

Changed in widelands:
status: Triaged → Fix Committed
SirVer (sirver) wrote :

Released in build-18 rc1.

Changed in widelands:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers