diff mbox series

evaluate: mark evaluate_generic_selection() as static

Message ID 37ef319f-ed1e-071d-ff4b-cb3a997fbf65@ramsayjones.plus.com (mailing list archive)
State Mainlined, archived
Headers show
Series evaluate: mark evaluate_generic_selection() as static | expand

Commit Message

Ramsay Jones May 30, 2020, 5:51 p.m. UTC
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.

Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
---
 evaluate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Luc Van Oostenryck May 30, 2020, 5:58 p.m. UTC | #1
On Sat, May 30, 2020 at 06:51:38PM +0100, Ramsay Jones wrote:
> 
> 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
diff mbox series

Patch

diff --git a/evaluate.c b/evaluate.c
index 5f2b7d6f..8d2e6869 100644
--- a/evaluate.c
+++ b/evaluate.c
@@ -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;