From owner-freebsd-hackers Sat Oct 12 7:13:46 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5C97A37B401; Sat, 12 Oct 2002 07:13:45 -0700 (PDT) Received: from chiark.greenend.org.uk (chiark.greenend.org.uk [212.135.138.206]) by mx1.FreeBSD.org (Postfix) with ESMTP id 182E343E7B; Sat, 12 Oct 2002 07:13:44 -0700 (PDT) (envelope-from fanf@chiark.greenend.org.uk) Received: from fanf by chiark.greenend.org.uk with local (Exim 3.12 #1) id 180N1N-0007BV-00 (Debian); Sat, 12 Oct 2002 15:13:37 +0100 Date: Sat, 12 Oct 2002 15:13:36 +0100 From: Tony Finch To: Terry Lambert Cc: Bruce Evans , Craig Rodrigues , freebsd-standards@FreeBSD.ORG, freebsd-hackers@FreeBSD.ORG Subject: Re: Problem detecting POSIX symbolic constants Message-ID: <20021012151336.A24868@chiark.greenend.org.uk> References: <20021012171803.F15910-100000@gamplex.bde.org> <3DA7E0F4.5988CA77@mindspring.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <3DA7E0F4.5988CA77@mindspring.com>; from tlambert2@mindspring.com on Sat, Oct 12, 2002 at 01:44:36AM -0700 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sat, Oct 12, 2002 at 01:44:36AM -0700, Terry Lambert wrote: > > I think the lack of "||" and "&&" mostly had to do with the fact > that there was conditional evaluation of the RHS of the operator, > based on the result of the LHS. > > With just an "&" or an "|", you actually need a much less complicated > state machine to evaluate a constant expression. With the "||"/"&&", > you almost have to do an edge associative operation, which implies a > much more complex state machine for the preprocessor, I think. No -- the short-circuiting behaviour of && and || only matters if you can have side-effects, which you can't in the preprocessor, so there is no need to implement it (unifdef doesn't). Tony. -- f.a.n.finch http://dotat.at/ THAMES DOVER: SOUTHEASTERLY VEERING NORTHWESTERLY 4 OR 5, OCCASIONALLY 6, BECOMING VARIABLE 3. RAIN OR SHOWERS. MODERATE OR GOOD. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message