Skip to contentSkip to conversation

evaluate: mark evaluate_generic_selection() as static

PATCH In review Ramsay Jones 2 participants 2 messages May 30, 2020 Sparse checker

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 evaluate: mark evaluate_generic_selection() as static

Commit c100a7ab (add support for _Generic, 2020-05-28) added the function evaluate_generic_selection() as an external symbol, without providing an external declaration in a header file. This causes sparse to issue a warning as part of the 'selfcheck' target.

Since this function does not (currently) need to be an external symbol, mark it as static.

---
 evaluate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
evaluate.c +1 -1
index 5f2b7d6f..8d2e6869 100644
@@ -3280,7 +3280,7 @@ static int type_selection(struct symbol *ctrl, struct symbol *type)
 	return !type_difference(&c, &t, 0, 0);
 }
 
-struct symbol *evaluate_generic_selection(struct expression *expr)
+static struct symbol *evaluate_generic_selection(struct expression *expr)
 {
 	struct type_expression *map;
 	struct expression *res;
Signature · 1 line
2.26.2
#1 lore raw
Quoted 8 lines · Ramsay Jones

Commit c100a7ab (add support for _Generic, 2020-05-28) added the function evaluate_generic_selection() as an external symbol, without providing an external declaration in a header file. This causes sparse to issue a warning as part of the 'selfcheck' target.

Since this function does not (currently) need to be an external symbol, mark it as static.

Hmm, yes. I should taste my own dogfood and use 'make selfcheck' ... Thanks.

-- Luc