From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 20135 invoked from network); 21 Jan 2021 18:34:44 -0000 Received: from 1ess.inri.net (216.126.196.35) by inbox.vuxu.org with ESMTPUTF8; 21 Jan 2021 18:34:44 -0000 Received: from mimir.eigenstate.org ([206.124.132.107]) by 1ess; Thu Jan 21 13:02:12 -0500 2021 Received: from abbatoir.fios-router.home (pool-74-101-2-6.nycmny.fios.verizon.net [74.101.2.6]) by mimir.eigenstate.org (OpenSMTPD) with ESMTPSA id 6b2bab80 (TLSv1.2:ECDHE-RSA-AES256-SHA:256:NO) for <9front@9front.org>; Thu, 21 Jan 2021 10:02:00 -0800 (PST) Message-ID: To: 9front@9front.org Date: Thu, 21 Jan 2021 10:01:59 -0800 From: ori@eigenstate.org In-Reply-To: <104278AC-1809-4746-B15E-376E33C8E212@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: responsive responsive DOM rich-client pipelining base-oriented backend Subject: Re: [9front] pcc macro issue Reply-To: 9front@9front.org Precedence: bulk Quoth Xiao-Yong Jin : > The following is wrong. > > cpu% cat test.c > #define N > #define F(x) > #define M F(N) > M > cpu% pcc -E test.c > cpp: test.c:4 Disagreement in number of macro arguments > #line 1 "/tmp/test.c" > > > > F() > pcc: cpp: cpp 25337: errors > Yep, I fixed a lot of problems in cpp, but this is one that I didn't get to. Another one is space handling, which we currently ignore. #define MAC(x) y MAC(x) // should expand to y MAC (x) // should remain untouched ANSI C macro expansion rules are subtle and arcane. I've got a few tests in my underwhelming regression suite, which may help if you want to take a stab at this: http://shithub.us/git/ori/regress/HEAD/cmd/cpp/f.html