[hackers] [scc] Avoid error() in cpp directives || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Thu, 13 Aug 2015 20:02:11 +0200 (CEST)

commit 2498915ac3402a2fc4cd4557aa3e1ea3bf24858d
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Thu Aug 13 17:53:50 2015 +0200
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Thu Aug 13 17:59:40 2015 +0200

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

diff --git a/cc1/cpp.c b/cc1/cpp.c
index 49f246e..bbfbb27 100644
--- a/cc1/cpp.c
+++ b/cc1/cpp.c
_AT_@ -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);
Received on Thu Aug 13 2015 - 20:02:11 CEST

This archive was generated by hypermail 2.3.0 : Thu Aug 13 2015 - 20:12:27 CEST