Only warn about reaching the end of a non-void function, if the return type is valid.
authorChristoph Mallon <christoph.mallon@gmx.de>
Thu, 28 Aug 2008 11:28:16 +0000 (11:28 +0000)
committerChristoph Mallon <christoph.mallon@gmx.de>
Thu, 28 Aug 2008 11:28:16 +0000 (11:28 +0000)
[r21535]

parser.c

index d764818..c9df2f3 100644 (file)
--- 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");