Ticket #42881

can_unit_do_activity_targeted_at(): ACTIVITY_PILLAGE case may fall through

Eröffnet am: 2021-09-19 14:41 Letztes Update: 2021-10-01 13:27

Auswertung:
Verantwortlicher:
Typ:
Status:
Geschlossen
Komponente:
Meilenstein:
Priorität:
5 - Mittel
Schweregrad:
5 - Mittel
Lösung:
Gefixt
Datei:
1

Details

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:
| ~

Ticket-Verlauf (3/5 Historien)

2021-09-19 14:41 Aktualisiert von: cazfi
  • New Ticket "can_unit_do_activity_targeted_at(): ACTIVITY_EXPLORE case may fall through" created
2021-09-23 11:23 Aktualisiert von: cazfi
  • Summary Updated
Kommentar

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 Aktualisiert von: cazfi
  • Lösung Update from Keine to Accepted
  • Meilenstein Update from (Keine) to 3.1.0 (closed)
2021-10-01 13:27 Aktualisiert von: cazfi
  • Status Update from Offen to Geschlossen
  • Verantwortlicher Update from (Keine) to cazfi
  • Lösung Update from Accepted to Gefixt

Bearbeiten

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