News:

The Forum Rules and Guidelines
Our forum has Rules and Guidelines. Please, be kind and read them ;).

Fixes for lots of warnings when compiling with Clang

Started by ceeac, May 19, 2020, 03:21:59 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ceeac

I made a PR to fix a large number of warnings which are emitted when compiling with clang on Linux. Some of those warnings revealed actual errors in the code; these errors should now be fixed.
The PR also reduces the number of lines emitted during a full re-compilation from >16000 to ~750, making it much easier to spot compile errors among all the warnings. The full list of compiler warnings is now as follows:

     48 [-Wsign-compare]
     18 [-Wcast-align]
     14 [-Wdeprecated-copy]
      8 [-Waddress-of-packed-member]
      3 [-Wreturn-std-move]
      2 [-Wtautological-constant-out-of-range-compare]
      2 [-Winvalid-source-encoding]
      2 [-Wenum-compare]
      1 [-W#warnings]
      1 [-Wstring-compare]
      1 [-Wpointer-bool-conversion]
      1 [-Wmisleading-indentation]
      1 [-Wint-in-bool-context]
      1 [-Wconstant-conversion]

Some of those warnings cannot be fixed since these are emitted by the squirrel code.
The PR is here.

jamespetts

Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.