scc

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

commit 2498915ac3402a2fc4cd4557aa3e1ea3bf24858d
parent dfb4776b82942448a8daa298b2ba280117f4ddce
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Thu, 13 Aug 2015 17:53:50 +0200

Avoid error() in cpp directives

Error() tries to recover from error and this is something
you don't want in a directive preprocessor.

Diffstat:
Mcc1/cpp.c | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/cc1/cpp.c b/cc1/cpp.c @@ -329,8 +329,10 @@ define(void) setnamespace(NS_CPP); next(); - if (yytoken != IDEN) - error("macro names must be identifiers"); + if (yytoken != IDEN) { + cpperror("macro names must be identifiers"); + return; + } sym = yylval.sym; if (sym->flags & ISDECLARED) { warn("'%s' redefined", yytext);