From dc33d43c46ad9c7c9892ea9cb3dc750ad18116e3 Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Sat, 16 Aug 2008 06:48:48 +0000 Subject: [PATCH] Do not warn about an ununsed function, if it is marked with __attribute__((used)). [r21210] --- parser.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/parser.c b/parser.c index 8e2cf3f..8688a93 100644 --- a/parser.c +++ b/parser.c @@ -8373,7 +8373,9 @@ static void check_unused_globals(void) return; for (const declaration_t *decl = global_scope->declarations; decl != NULL; decl = decl->next) { - if (decl->used || decl->storage_class != STORAGE_CLASS_STATIC) + if (decl->used || + decl->modifiers & DM_USED || + decl->storage_class != STORAGE_CLASS_STATIC) continue; type_t *const type = decl->type; -- 2.20.1