Do not warn about the return type of main(), if it is the error type.
authorChristoph Mallon <christoph.mallon@gmx.de>
Tue, 16 Sep 2008 18:11:08 +0000 (18:11 +0000)
committerChristoph Mallon <christoph.mallon@gmx.de>
Tue, 16 Sep 2008 18:11:08 +0000 (18:11 +0000)
[r22017]

parser.c

index 7c66bb8..e5fb27f 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -4311,7 +4311,7 @@ static void check_type_of_main(const declaration_t *const decl, const function_t
                warningf(&decl->source_position,
                         "'main' is normally a non-static function");
        }
-       if (skip_typeref(func_type->return_type) != type_int) {
+       if (!types_compatible(skip_typeref(func_type->return_type), type_int)) {
                warningf(&decl->source_position,
                         "return type of 'main' should be 'int', but is '%T'",
                         func_type->return_type);