shithub: scc

Download patch

ref: 079f3c6e917203d8d5a2043182927231c60ea231
parent: 994751d39485e086ef623f202fb1b84729fd5d19
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Sat May 28 07:05:35 EDT 2022

cc1: Reject macro expansion with parenthesis

The code was not rejecting macros alike functions without
parameters that were invocated without parenthesis.

--- a/src/cmd/cc/cc1/cpp.c
+++ b/src/cmd/cc/cc1/cpp.c
@@ -146,8 +146,8 @@
 	int n;
 
 	if (mp->npars == -1)
-		return -1;
-	if (ahead() != '(' && mp->npars > 0)
+		return 1;
+	if (ahead() != '(')
 		return 0;
 
 	disexpand = 1;