[hackers] [scc] [cc1] Add an explicit message to void main() diagnostic || Quentin Rameau

From: <git_AT_suckless.org>
Date: Mon, 12 Dec 2016 14:30:47 +0100 (CET)

commit 8b92118dfdba682911e838d4aa0c02758a2adf9d
Author: Quentin Rameau <quinq_AT_fifth.space>
AuthorDate: Mon Dec 12 13:53:14 2016 +0100
Commit: Quentin Rameau <quinq_AT_fifth.space>
CommitDate: Mon Dec 12 13:56:37 2016 +0100

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

diff --git a/cc1/decl.c b/cc1/decl.c
index 437f52f..ee97af0 100644
--- a/cc1/decl.c
+++ b/cc1/decl.c
_AT_@ -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) {
Received on Mon Dec 12 2016 - 14:30:47 CET

This archive was generated by hypermail 2.3.0 : Mon Dec 12 2016 - 14:36:15 CET