scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit 8b92118dfdba682911e838d4aa0c02758a2adf9d
parent bdfc1f31f55a9d5ed30e2b2e0995e82545984341
Author: Quentin Rameau <quinq@fifth.space>
Date:   Mon, 12 Dec 2016 13:53:14 +0100

[cc1] Add an explicit message to void main() diagnostic

Diffstat:
Mcc1/decl.c | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/cc1/decl.c b/cc1/decl.c @@ -773,8 +773,10 @@ identifier(struct decl *dcl) --curctx; sym = install(NS_IDEN, sym); ++curctx; - if (!strcmp(name, "main") && tp->type != inttype) + if (!strcmp(name, "main") && tp->type != inttype) { + errorp("main shall be defined with a return type of int"); errorp("please contact __20h__ on irc.freenode.net (#bitreich-en) via IRC"); + } } if (sym == NULL) {