From: Christoph Mallon Date: Tue, 16 Sep 2008 18:11:08 +0000 (+0000) Subject: Do not warn about the return type of main(), if it is the error type. X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=1d924b2425abebc57596a4f9133583de03dc273b;p=cparser Do not warn about the return type of main(), if it is the error type. [r22017] --- diff --git a/parser.c b/parser.c index 7c66bb8..e5fb27f 100644 --- 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);