Incidencia #43868

fc_strrep_resize(): 'success' set, but never used in FREECIV_NDEBUG build

Abrir Fecha: 2022-02-15 14:01 Última actualización: 2022-05-05 08:15

Informador:
Propietario:
Tipo:
Estado:
Cerrado
Componente:
Prioridad:
5 - Medium
Gravedad:
5 - Medium
Resolución:
Fixed
Fichero:
3

Details

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)

674 | bool success;

Ticket History (3/10 Histories)

2022-02-15 14:01 Updated by: cazfi
  • New Ticket "fc_strrep_resize(): 'success' set, but never used in FREECIV_NDEBUG build" created
2022-04-09 05:42 Updated by: cazfi
Comentario

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...

2022-04-14 14:27 Updated by: cazfi
Comentario

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.

2022-04-19 15:27 Updated by: cazfi
Comentario

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.

2022-04-23 06:29 Updated by: cazfi
  • Propietario Update from (Ninguno) to cazfi
  • Resolución Update from Ninguno to Accepted
2022-04-23 16:12 Updated by: cazfi
Comentario

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.

2022-05-05 08:15 Updated by: cazfi
  • Estado Update from Open to Cerrado
  • Resolución Update from Accepted to Fixed

Editar

Please login to add comment to this ticket » Entrar