Compilation warnings with Clang (3.5)

Bug #1258667 reported by Hans Joachim Desserud
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Fix Released
Low
Unassigned

Bug Description

Clang/LLVM 3.4 is scheduled to be released soon, and the release candidate is packaged in Debian Unstable. I took Widelands* for a spin, and while the 3.4 release doesn't seem to spot any additional warnings, we have some which should be looked into/fixed. Most of them concerns the same entity which are declared as structs and classes in different places of the code. (I noticed this a while back and since I knew we wanted to use classes throughout I worked a bit on branch for it. Unfortunately it fails to compile due to default private accesibility in classes and I wasn't really comfortable setting _everything_ to public as that might not have been the original intention. So someone else should probably look at that.)

Since bug 913369 was closed once we became warning-free, I've filed a separate bug for the ones which have been added since then.

*latest trunk at the time was r6820

PS. For other warning reports, see bug 986611 (cppcheck), bug 1278174 (flawfinder) and bug 1202101 (Visual Studio).

Revision history for this message
Hans Joachim Desserud (hjd) wrote :
description: updated
description: updated
description: updated
Revision history for this message
SirVer (sirver) wrote :

Setting to incomplete for bug sweeping.

Changed in widelands:
status: Triaged → Incomplete
Revision history for this message
Hans Joachim Desserud (hjd) wrote :

Clang/LLVM 3.5 has just been released so reran this. Since the last time there has of course been plenty of code changes, but we've also tweaked the build system and warnings used. Now we set the flag -Weverything when building with Clang which means it report anything it is able to find in the code (including experimental checks). The code base seem to be in good shape though, there are some warnings which are code-related but the vast majority deals with documentation and comments.

Most of the documentation should be easy to fix, though it would be nice if someone could doublecheck some of them to verify Clang is checking for the comment style we wish to use. I'm particularly thinking of comments like
//< Default width for ware's menu icons
where Clang doesn't like the '<' character. Which to some extent is understandable, though I'm not familiar with Doxygen so I don't know whether it was added for a reason and used when Doxygen is collection the documentation from source files (or something else for that matter).

PS. Removed milestone for the time being. Personally I'd say becoming warning free should be a goal for the release, but as new warnings are added and compilers are released I realize this is an ongoing process.

summary: - Compilation warnings with Clang (3.4)
+ Compilation warnings with Clang (3.5)
Changed in widelands:
milestone: build19-rc1 → none
status: Incomplete → Confirmed
Revision history for this message
GunChleoc (gunchleoc) wrote :

These have been fixed. We can keep an eye on Travis in the future to keep the number of warnings down.

Changed in widelands:
status: Confirmed → Fix Committed
milestone: none → build20-rc1
Revision history for this message
GunChleoc (gunchleoc) wrote :

Fixed in build20-rc1

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.