The International Simutrans Forum

Simutrans Extended => Simutrans-Extended development => Simutrans-Extended bug reports => Topic started by: ceeac on May 19, 2020, 03:21:59 PM

Title: Fixes for lots of warnings when compiling with Clang
Post by: ceeac on May 19, 2020, 03:21:59 PM
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 (https://github.com/jamespetts/simutrans-extended/pull/171).
Title: Re: Fixes for lots of warnings when compiling with Clang
Post by: jamespetts on May 19, 2020, 07:15:18 PM
Thank you - now incorporated.