[hackers] [scc] Disable macro expansions in cpp clausules || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Sat, 18 Jul 2015 07:32:10 +0200 (CEST)

commit e21b9b0779b6daa0e082d059ce6a179f4b454bef
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Fri Jul 17 22:56:38 2015 +0200
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Fri Jul 17 23:14:53 2015 +0200

    Disable macro expansions in cpp clausules
    
    It is mandatory by the standard, and it is needed
    beause in other case you can have recursion problems

diff --git a/cc1/cpp.c b/cc1/cpp.c
index b66c45b..b904e5a 100644
--- a/cc1/cpp.c
+++ b/cc1/cpp.c
_AT_@ -532,6 +532,8 @@ cpp(void)
         if (*input->p != '#')
                 return 0;
         ++input->p;
+
+ disexpand = 1;
         lexmode = CPPMODE;
         setnamespace(NS_CPPCLAUSES);
         next();
_AT_@ -544,6 +546,8 @@ cpp(void)
 
         if (yytoken != EOFTOK && !cppoff)
                 error("trailing characters after preprocessor directive");
+ disexpand = 0;
         lexmode = CCMODE;
+
         return 1;
 }
Received on Sat Jul 18 2015 - 07:32:10 CEST

This archive was generated by hypermail 2.3.0 : Sat Jul 18 2015 - 07:36:25 CEST