Ticket #45941

specenum_gen.h -Wtautological-constant-out-of-range-compare

Date d'ouverture: 2022-10-21 08:50 Dernière mise à jour: 2022-11-02 19:14

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

Détails

In an attempt to add Qt-client build to mac-meson CI job results in a lot of -Wtautological-constant-out-of-range-compare about specenum_gen.h

Starting with:

--

[530/700] Compiling C++ object freeciv-qt.p/meson-generated_moc_mapview.cpp.o
FAILED: freeciv-qt.p/meson-generated_moc_mapview.cpp.o
c++ -Ifreeciv-qt.p -I. -I.. -I../dependencies/luasql/src -I../dependencies/tinycthread -I../dependencies/tolua-5.2/include -I../dependencies/cvercmp -I../utility -I../common -I../common/networking -I../common/scriptcore -I../common/aicore -I../client -I../client/include -I../client/luascript -I../client/agents -I../client/gui-qt -I/usr/local/lib/QtCore.framework/Headers -I/usr/local/lib/QtGui.framework/Headers -I/usr/local/lib/QtWidgets.framework/Headers -I/usr/local/opt/readline/include -fcolor-diagnostics -Wall -Winvalid-pch -Wnon-virtual-dtor -std=c++17 -O0 -g -fPIC -Werror -DQT_DISABLE_DEPRECATED_BEFORE=0x060000 -DHAVE_CONFIG_H -F/usr/local/lib -F/usr/local/lib -F/usr/local/lib -MD -MQ freeciv-qt.p/meson-generated_moc_mapview.cpp.o -MF freeciv-qt.p/meson-generated_moc_mapview.cpp.o.d -o freeciv-qt.p/meson-generated_moc_mapview.cpp.o -c freeciv-qt.p/moc_mapview.cpp
In file included from freeciv-qt.p/moc_mapview.cpp:10:
In file included from freeciv-qt.p/../../client/gui-qt/mapview.h:26:
In file included from ../client/include/mapview_g.h:20:
In file included from ../common/fc_types.h:359:
./specenum_gen.h:5452:18: error: result of comparison of constant 4 with expression of type 'enum casus_belli_range' is always true [-Werror,-Wtautological-constant-out-of-range-compare]

if (enumerator < ARRAY_SIZE(names)) {

Ticket History (3/6 Histories)

2022-10-21 08:50 Updated by: cazfi
  • New Ticket "/specenum_gen.h -Wtautological-constant-out-of-range-compare" created
2022-10-21 08:51 Updated by: cazfi
  • Summary Updated
2022-10-22 11:36 Updated by: cazfi
  • Jalon Update from (Aucun) to 3.0.5 (atteints)
  • Composant Update from (Aucun) to General
Commentaire

The code is similar in all branches, so the build failure might come up in any branch at some point - that it has so far been seen with Meson builds only is likely just due to a bit different compiler flags there.

2022-10-29 02:17 Updated by: cazfi
  • Propriétaire Update from (Aucun) to cazfi
  • Résolution Update from Aucun to Accepted
2022-11-02 19:14 Updated by: cazfi
  • État Update from Ouvert to Atteints
  • Résolution Update from Accepted to Fixed

Modifier

Please login to add comment to this ticket » Connexion