From 66966ad8651f6e2905479fe704e838b0b547ad20 Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Thu, 28 Aug 2008 11:28:16 +0000 Subject: [PATCH] Only warn about reaching the end of a non-void function, if the return type is valid. [r21535] --- parser.c | 1 + 1 file changed, 1 insertion(+) diff --git a/parser.c b/parser.c index d764818..c9df2f3 100644 --- a/parser.c +++ b/parser.c @@ -4898,6 +4898,7 @@ found_break_parent: type_t *const ret = skip_typeref(type->function.return_type); if (warning.return_type && !is_type_atomic(ret, ATOMIC_TYPE_VOID) && + is_type_valid(ret) && !is_sym_main(current_function->symbol)) { warningf(&stmt->base.source_position, "control reaches end of non-void function"); -- 2.20.1