Do not warn about an ununsed function, if it is marked with __attribute__((used)).
authorChristoph Mallon <christoph.mallon@gmx.de>
Sat, 16 Aug 2008 06:48:48 +0000 (06:48 +0000)
committerChristoph Mallon <christoph.mallon@gmx.de>
Sat, 16 Aug 2008 06:48:48 +0000 (06:48 +0000)
[r21210]

parser.c

index 8e2cf3f..8688a93 100644 (file)
--- 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;