From 8aeaa3f6a697b5f3698df667c4f5620af8377f65 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Thu, 13 Oct 2022 17:01:34 +0300 Subject: [PATCH] Reimplement action_id_exists() to silence gcc-5.4 array-bounds warning The assumption is that the warning seen only with very old version of gcc was a false positive. The functionality is not changed at all, code has only been rearranged (inline function identical to old implementation gets drawn in) See osdn #45853 Signed-off-by: Marko Lindqvist --- common/actions.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/common/actions.c b/common/actions.c index d359c9fca3..7e618b070b 100644 --- a/common/actions.c +++ b/common/actions.c @@ -729,8 +729,7 @@ static struct action *action_new(action_id id, **************************************************************************/ bool action_id_exists(const action_id act_id) { - /* Actions are still hard coded. */ - return gen_action_is_valid(act_id) && actions[act_id]; + return (action_by_number(act_id) != NULL); } /************************************************************************** -- 2.35.1