- do not issue warnings for unused parameters of main: gcc suppresses them
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Sun, 31 Aug 2008 12:42:20 +0000 (12:42 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Sun, 31 Aug 2008 12:42:20 +0000 (12:42 +0000)
[r21585]

parser.c

index 5961692..3b06caf 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -4706,6 +4706,10 @@ static void check_declarations(void)
        if (warning.unused_parameter) {
                const scope_t *scope = &current_function->scope;
 
+               if (is_sym_main(current_function->symbol)) {
+                       /* do not issue unused warnings for main */
+                       return;
+               }
                const declaration_t *parameter = scope->declarations;
                for (; parameter != NULL; parameter = parameter->next) {
                        if (! parameter->used) {