Ticket #44882

citizenshand.c doing useless work when FREECIV_DEBUG not set

Date d'ouverture: 2022-06-20 23:00 Dernière mise à jour: 2022-06-25 17:12

Rapporteur:
Propriétaire:
Type:
État:
Atteints
Composant:
Priorité:
5 - moyen
Sévérité:
5 - moyen
Résolution:
Fixed
Fichier:
3

Détails

../../../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
  • Priorité Update from 5 - moyen to 9 - le plus élevé
Commentaire

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
  • Propriétaire Update from (Aucun) to cazfi
  • Résolution Update from Aucun to Accepted
  • Jalon Update from (Aucun) to 3.1.0
Commentaire

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
Commentaire

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

2022-06-23 03:00 Updated by: cazfi
Commentaire

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
  • Priorité Update from 9 - le plus élevé to 5 - moyen
2022-06-25 17:12 Updated by: cazfi
  • État Update from Ouvert to Atteints
  • Résolution Update from Accepted to Fixed

Modifier

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Connexion