fc_strrep_resize(): 'success' set, but never used in FREECIV_NDEBUG build
I've been treating this as a generic ticket for all similar errors with degug+ndebug build that are not handled separately for having more serious consequences. My local patch file is growing as I get further and further in the build...
The original reason I started to look at this was that I were trying to set up some static analysis tool runs. There's quite a conceptual clash with asserts(). We assert that something is true, and remains so when the code changes. The tools determine the very same thing; that the thing is certainly true, but then conclude that code within our assert() is thus redundant. So need to disable asserts for such builds, at which point some compiler warnings not usually enabled in our FREECIV_NDEBUG became an issue. So need to get NDEBUG build to build without errors with our full set of --enable-debug warnings.
Reply To cazfi
The original reason I started to look at this was that I were trying to set up some static analysis tool runs.
Getting there. But OTOH it's going to be the beginning. We're going to get a lot of new issues detected by this.
Reply To cazfi
Reply To cazfi
The original reason I started to look at this was that I were trying to set up some static analysis tool runs.
Getting there. But OTOH it's going to be the beginning. We're going to get a lot of new issues detected by this.
Summary from initial scan run on S3_0 attached - 289 issues to look at.
Building with both FREECIV_NDEBUG (to disable asserts) and --enable-debug (to have all the compiler warnings). S3_0 compile ends to:
../../../src/utility/support.c: In function ‘fc_strrep_resize’:
../../../src/utility/support.c:674:8: error: variable ‘success’ set but not used (-Werror=unused-but-set-variable)