任务单 #45941

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

开放日期: 2022-10-21 08:50 最后更新: 2022-11-02 19:14

报告人:
属主:
类型:
状态:
关闭
组件:
里程碑:
优先:
5 - Medium
严重性:
5 - Medium
处理结果:
Fixed
文件:
1

Details

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)) {

任务单历史 (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
  • 里程碑 Update from (无) to 3.0.5 (关闭)
  • 组件 Update from (无) to General
评论

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
  • 属主 Update from (无) to cazfi
  • 处理结果 Update from to Accepted
2022-11-02 19:14 Updated by: cazfi
  • 状态 Update from 开启 to 关闭
  • 处理结果 Update from Accepted to Fixed

编辑

Please login to add comment to this ticket » 登录名