shithub: scc

Download patch

ref: 45110f5f227f83965b9a008e52096b45e4b72d12
parent: 9e72a9ad124dfe246dba4d7c0695d5580aa187f8
author: Quentin Rameau <quinq@fifth.space>
date: Mon Dec 12 08:53:14 EST 2016

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

--- a/cc1/decl.c
+++ b/cc1/decl.c
@@ -773,8 +773,10 @@
 		--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) {