URL:
<http://gna.org/bugs/?23587>
Summary: -O3 compile problem on unittype.c
Project: Freeciv
Submitted by: cazfi
Submitted on: Sun 10 May 2015 05:59:45 PM EEST
Category: None
Severity: 3 - Normal
Priority: 5 - Normal
Status: None
Assigned to: None
Originator Email:
Open/Closed: Open
Release:
Discussion Lock: Any
Operating System: None
Planned Release:
_______________________________________________________
Details:
common/unittype.c: In function 'unit_state_action_cache_set':
common/unittype.c:372:32: error: array subscript is below array bounds
[-Werror=array-bounds]
BV_CLR_ALL(ustate_act_cache[utype_index(putype)][ACTION_ANY]);
I think the compiler thinks that putype can be NULL. At least adding "if
(putype == NULL) { return; }" in the previous line makes the warning to go
away.
OTOH adding "if (putype != NULL) {" and "}" around the only call of that
function does not help.
_______________________________________________________
Reply to this item at:
<http://gna.org/bugs/?23587>
_______________________________________________
Message sent via/by Gna!
http://gna.org/
_______________________________________________
Freeciv-dev mailing list
[email protected]
https://mail.gna.org/listinfo/freeciv-dev