チケット #42881

can_unit_do_activity_targeted_at(): ACTIVITY_PILLAGE case may fall through

登録: 2021-09-19 14:41 最終更新: 2021-10-01 13:27

報告者:
担当者:
チケットの種類:
状況:
完了
コンポーネント:
マイルストーン:
優先度:
5 - 中
重要度:
5 - 中
解決法:
修正済み
ファイル:
1

詳細

With -Wimplicit-fallthrough in master:

../../../src/common/unit.c: In function ‘can_unit_do_activity_targeted_at’:
../../../src/common/unit.c:913:5: error: this statement may fall through -Werror=implicit-fallthrough=

913 | switch (action_get_target_kind(paction)) { \
| ~

../../../src/common/unit.c:913:5: note: in definition of macro ‘RETURN_IS_ACTIVITY_ENABLED_UNIT_ON’

913 | switch (action_get_target_kind(paction)) { \
| ~

../../../src/common/unit.c:1019:3: note: here

1019 | case ACTIVITY_EXPLORE:
| ~

チケットの履歴 (5 件中 3 件表示)

2021-09-19 14:41 更新者: cazfi
  • 新しいチケット "can_unit_do_activity_targeted_at(): ACTIVITY_EXPLORE case may fall through" が作成されました
2021-09-23 11:23 更新者: cazfi
  • 概要が更新されました
コメント

It's the ACTIVITY_PILLAGE case above that is falling through *to* ACTIVITY_EXPLORE.

The problem is in macro RETURN_IS_ACTIVITY_ENABLED_UNIT_ON() that has no return for invalid value.

2021-09-23 11:29 更新者: cazfi
  • 解決法なし から 受領 に更新されました
  • マイルストーン(未割り当て) から 3.1.0 (完了済み) に更新されました
2021-10-01 13:27 更新者: cazfi
  • 状況オープン から 完了 に更新されました
  • 担当者(未割り当て) から cazfi に更新されました
  • 解決法受領 から 修正済み に更新されました

編集

このチケットにコメントを追加するには、ログインが必要です » ログインする