shithub: scc

Download patch

ref: f40eebe22cd78f1256af2ea86fe9f64a4d74f00e
parent: dfda6fe8550bbdbf1176c76cdbc943cc5a6dec86
author: Roberto E. Vargas Caballero <[email protected]>
date: Sat Sep 26 18:06:52 EDT 2015

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.

--- a/cc1/cpp.c
+++ b/cc1/cpp.c
@@ -67,6 +67,8 @@
 	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++ = ' ';