Comment 0 for bug 913369

Revision history for this message
Hans Joachim Desserud (hjd) wrote :

First of all, note that builds compiled with clang has some problems and will currently crash (see bug 744595 for details). That is naturally a lot more severe issue which should be sorted out, before we can start using clang normally.

However, compiling with clang will output a ton of warnings (a lot more than GCC). I realize in the current state it looks rather noisy (more than 27000 lines), however I believe that fixing these warnings will sort out issues in the code, and also make it easier to spot when new warnings are introduced by new code.

At a glance there seem to be a couple of issues which seem to trigger the most warnings:
* Mixed use of struct/class. Declared as one, but refered to as the other in another place. I suspect this could be easily fixed by a) checking what it is declared as in the first place and b) run some combination of find/sed replacing all occurances of "struct name" with "class name" or vice versa.
* Virtual functions are overloaded.
* Several other minor issues

I suspect there is a lot of low-hanging fruit in here, and it might be suitable new contributors. Though note that since clang is not used currently, so consider this EXTREMELY LOW priority. Still, it would always be nice to reduce the amount of warnings :)

PS. See also bug 825957 for GCC-warnings.

Some technical info:

Widelands bzr r6183 compiled with Clang (LLVM) 3.0-1 on Arch.

Compiled with the following options
 cmake ../widelands -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/opt/widelands-clang/build/ -DWL_PORTABLE=true -DWL_EXTRAWARNINGS=true -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++

Note that -DWL_EXTRAWARNINGS include -Wextra in addition to -Wall which is enabled by default.