[hackers] [scc] Mark as used parameters in macro invocations || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Sat, 26 Sep 2015 22:09:42 +0200 (CEST)

commit f40eebe22cd78f1256af2ea86fe9f64a4d74f00e
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Sat Sep 26 22:06:52 2015 +0200
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Sat Sep 26 22:06:52 2015 +0200

    Mark as used parameters in macro invocations
    
    If we don't mark them as used then any non used parameter of a macro
    will generate a warning in every invocation of the macro.

diff --git a/cc1/cpp.c b/cc1/cpp.c
index 5bc0515..7205328 100644
--- a/cc1/cpp.c
+++ b/cc1/cpp.c
_AT_@ -67,6 +67,8 @@ nextcpp(void)
         if (yylen + 1 > arglen)
                 error("argument overflow invoking macro \"%s\"",
                       macroname);
+ if (yytoken == IDEN)
+ yylval.sym->flags |= ISUSED;
         memcpy(argp, yytext, yylen);
         argp += yylen;
         *argp++ = ' ';
Received on Sat Sep 26 2015 - 22:09:42 CEST

This archive was generated by hypermail 2.3.0 : Sat Sep 26 2015 - 22:12:12 CEST