Tíquete #44882

citizenshand.c doing useless work when FREECIV_DEBUG not set

: 2022-06-20 23:00 Última Atualização: 2022-06-25 17:12

Relator:
Dono:
Tipo:
Estado:
Fechado
Componente:
Marcos:
Prioridade:
5 - Medium
Gravidade:
5 - Medium
Resolução:
Fixed
Arquivo:
3

Details

../../../src/server/citizenshand.c:159:18: warning: variable 'pplayer' set but not used [-Wunused-but-set-variable!]

That's basically because pplayer would only be used in log_citizens(), which currently is defined as log_debug(), which expands to nothing when FREECIV_DEBUG is not set.

Ideally the fix would support changing log_citizens() to be something else than log_debug()

Ticket History (3/10 Histories)

2022-06-20 23:00 Updated by: cazfi
  • New Ticket "citizenshand.c doing useless work when FREECIV_DEBUG not set" created
2022-06-23 01:29 Updated by: cazfi
  • Prioridade Update from 5 - Medium to 9 - Highest
Comentário

Reply To cazfi

../../../src/server/citizenshand.c:159:18: warning: variable 'pplayer' set but not used [-Wunused-but-set-variable!]

That's a build failure on CI now. To be resolved as an emergency fix.

2022-06-23 02:03 Updated by: cazfi
  • Dono Update from (Nenhum) to cazfi
  • Resolução Update from Nenhum to Accepted
  • Marco Update from (Nenhum) to 3.1.0 (fechado)
Comentário

Fix to immediate build issues (as quickly reproduced - can't promise there isn't failing corner cases still) attached. Will push immediately.

2022-06-23 02:31 Updated by: cazfi
Comentário

Further adjustment, going to push that one too (to S3_1 and master).

2022-06-23 03:00 Updated by: cazfi
Comentário

S3_0 patch attached. That one is not for an emergency, but has the usual review period.

All branches pass all eight combinations of debug/not, ndebug/not, LOG_CITIZENS_DEBUG/not

2022-06-23 08:03 Updated by: cazfi
  • Prioridade Update from 9 - Highest to 5 - Medium
2022-06-25 17:12 Updated by: cazfi
  • Estado Update from Aberto to Fechado
  • Resolução Update from Accepted to Fixed

Editar

Please login to add comment to this ticket » Login