scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

commit 079f3c6e917203d8d5a2043182927231c60ea231
parent 994751d39485e086ef623f202fb1b84729fd5d19
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Sat, 28 May 2022 11:05:35 +0200

cc1: Reject macro expansion with parenthesis

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

Diffstat:
Msrc/cmd/cc/cc1/cpp.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

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