Incidencia #42881

can_unit_do_activity_targeted_at(): ACTIVITY_PILLAGE case may fall through

Abrir Fecha: 2021-09-19 14:41 Última actualización: 2021-10-01 13:27

Informador:
Propietario:
Tipo:
Estado:
Cerrado
Componente:
Prioridad:
5 - Medium
Gravedad:
5 - Medium
Resolución:
Fixed
Fichero:
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 History (3/5 Histories)

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

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 Updated by: cazfi
  • Resolución Update from Ninguno to Accepted
  • Hito Update from (Ninguno) to 3.1.0 (cerrado)
2021-10-01 13:27 Updated by: cazfi
  • Estado Update from Open to Cerrado
  • Propietario Update from (Ninguno) to cazfi
  • Resolución Update from Accepted to Fixed

Editar

Please login to add comment to this ticket » Entrar