From 57d7d7608a5d309030ccb025b253584caae0cda5 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Sun, 31 Aug 2008 12:42:20 +0000 Subject: [PATCH] - do not issue warnings for unused parameters of main: gcc suppresses them [r21585] --- parser.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/parser.c b/parser.c index 5961692..3b06caf 100644 --- a/parser.c +++ b/parser.c @@ -4706,6 +4706,10 @@ static void check_declarations(void) if (warning.unused_parameter) { const scope_t *scope = ¤t_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) { -- 2.20.1