From owner-freebsd-hackers Mon Apr 21 14:00:51 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id OAA13724 for hackers-outgoing; Mon, 21 Apr 1997 14:00:51 -0700 (PDT) Received: (from hsu@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id OAA13718 for hackers; Mon, 21 Apr 1997 14:00:48 -0700 (PDT) Date: Mon, 21 Apr 1997 14:00:48 -0700 (PDT) From: Jeffrey Hsu Message-Id: <199704212100.OAA13718@freefall.freebsd.org> To: hackers Subject: m4 bug? Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk The Solaris version of the m4 preprocessor gives the same output for both functions below while our m4 only works for the first definition. The intended output is to print all of the arguments. Is this a bug in our m4 or a buggy m4 code hidden by a bug in the Solaris m4? My reading of the code is that the first level of quotes is stripped off by the m4 preprocessor in reading the definition of iter2, so the $@ is passed without interpretation already, and hence, should really be a $*. That is, I think it's a bug in the Solaris m4. ----------------------------cut here-------------------------- define(iter1, ` $1 ifelse($2, `', `', `iter1(shift($*))')') iter1(a, b, c) define(iter2, ` $1 ifelse($2, `', `', `iter2(shift($@))')') iter2(a, b, c)