From owner-freebsd-arch@FreeBSD.ORG Sun Apr 25 18:04:14 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 66B3316A4DA for ; Sun, 25 Apr 2004 18:04:14 -0700 (PDT) Received: from edgemaster.zombie.org (edgemaster.creighton.edu [147.134.112.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0FF6C43D45 for ; Sun, 25 Apr 2004 17:40:20 -0700 (PDT) (envelope-from smkelly@FreeBSD.org) Received: by edgemaster.zombie.org (Postfix, from userid 1001) id 5B17C39839; Sun, 25 Apr 2004 19:40:10 -0500 (CDT) Date: Sun, 25 Apr 2004 19:40:10 -0500 From: Sean Kelly To: arch@freebsd.org Message-ID: <20040426004010.GA31337@edgemaster.zombie.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6i Subject: m4 modifications? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2004 01:04:15 -0000 I am currently dealing with a PR (bin/60914). This PR addresses several shortcomings and flaws in our m4 implementation, including: * The bitwise operators not behaving like bitwise operators * Improper operator precdence * Weak error messages * Short-circuit evaluation The last item in that list is the one which is the one I am fishing for opinions and insight on. In our current m4, there is no short-circuit evaluation of expressions: $ echo "eval(1 || (1/0))" | m4 m4: division by zero in eval. The PR submitter's patch changes our m4 to properly(?) evaluate this to 1, obeying short-circuit evaluation. The problem is that it is unclear to me whether this is the way it should be done. No other m4 implementation that I can find does short-circuit evaluation, including GNU, HP-UX's, and Solaris. According to SUSv3: All of the C-language operators shall be supported, except for: [] -> ++ -- (type) unary * sizeof . ?: unary & and all assignment operators. Precedence and associativity shall be as in the ISO C standard. Does that imply that short-circuit evaluation should be done? If so, should we do it even though nobody else seems to? If it is vague, should we do it? My experience with m4 is somewhat limited, and this is not an area where I can speak authoritatively. -- Sean Kelly | PGP KeyID: D2E5E296 smkelly@FreeBSD.org | http://www.sean-kelly.org/