From owner-freebsd-standards@FreeBSD.ORG Thu Jun 30 18:04:50 2011 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 419D61065672 for ; Thu, 30 Jun 2011 18:04:50 +0000 (UTC) (envelope-from wollman@khavrinen.csail.mit.edu) Received: from khavrinen.csail.mit.edu (khavrinen.csail.mit.edu [128.30.28.20]) by mx1.freebsd.org (Postfix) with ESMTP id 036C78FC0C for ; Thu, 30 Jun 2011 18:04:49 +0000 (UTC) Received: from khavrinen.csail.mit.edu (localhost [127.0.0.1]) by khavrinen.csail.mit.edu (8.14.4/8.14.4) with ESMTP id p5UHqslg094336 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL CN=khavrinen.csail.mit.edu issuer=Client+20CA); Thu, 30 Jun 2011 13:52:54 -0400 (EDT) (envelope-from wollman@khavrinen.csail.mit.edu) Received: (from wollman@localhost) by khavrinen.csail.mit.edu (8.14.4/8.14.4/Submit) id p5UHqsNq094333; Thu, 30 Jun 2011 13:52:54 -0400 (EDT) (envelope-from wollman) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19980.47094.184089.398324@khavrinen.csail.mit.edu> Date: Thu, 30 Jun 2011 13:52:54 -0400 From: Garrett Wollman To: Stefan Esser In-Reply-To: <4E0CACFB.8040906@freebsd.org> References: <4E09AF8E.5010509@freebsd.org> <4E0B860E.50504@freebsd.org> <20110630164653.GA82980@zim.MIT.EDU> <4E0CACFB.8040906@freebsd.org> X-Mailer: VM 7.17 under 21.4 (patch 22) "Instant Classic" XEmacs Lucid X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (khavrinen.csail.mit.edu [127.0.0.1]); Thu, 30 Jun 2011 13:52:54 -0400 (EDT) Cc: freebsd-standards@freebsd.org Subject: Re: Fwd: [RFC] Consistent numeric range for "expr" on all architectures X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jun 2011 18:04:50 -0000 < said: > Well, that's the frustrating part: I had implemented 64bit range in expr > back in 2000, but this extended range (on 32bit archs) has been made > optional, some two years later with the commit message you quote. The 2001 POSIX standard states: > Integer variables and constants, including the values of operands > and option-arguments, used by the standard utilities listed in this > volume of IEEE Std 1003.1-2001 shall be implemented as equivalent to > the ISO C standard signed long data type; floating point shall be > implemented as equivalent to the ISO C standard double > type. Conversions between types shall be as described in the ISO C > standard. All variables shall be initialized to zero if they are not > otherwise assigned by the input to the application. > Arithmetic operators and control flow keywords shall be implemented > as equivalent to those in the cited ISO C standard section, as > listed in Table 1-2 (on page 8). However, for arithemtic expansion in the shell (but *not* the expr utility), it says: > As an extension, the shell may recognize arithmetic expressions > beyond those listed. The shell may use a signed integer type with a > rank larger than the rank of signed long. The shell may use a > real-floating type instead of signed long as long as it does not > affect the results in cases where there is no overflow. The language in the 2008 version of the standard is the same. For expr, the following definitions are relevant (from XCU7 page 2715): > integer An argument consisting only of an (optional) unary minus > followed by digits. > string A string argument; see below. [...] > A string argument is an argument that cannot be identified as an > integer argument or as one of the expression operator symbols shown > in the OPERANDS section. I'm unable to find the response to my interpretation request in the Austin Group mail archives. -GAWollman