projects
/
cparser
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e5e449a
)
Do not warn about the return type of main(), if it is the error type.
author
Christoph Mallon
<christoph.mallon@gmx.de>
Tue, 16 Sep 2008 18:11:08 +0000
(18:11 +0000)
committer
Christoph Mallon
<christoph.mallon@gmx.de>
Tue, 16 Sep 2008 18:11:08 +0000
(18:11 +0000)
[r22017]
parser.c
patch
|
blob
|
history
diff --git
a/parser.c
b/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);