From owner-freebsd-standards@FreeBSD.ORG Sat Apr 19 18:50:29 2003 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 931) id 19B6437B401; Sat, 19 Apr 2003 18:50:29 -0700 (PDT) Date: Sat, 19 Apr 2003 20:50:29 -0500 From: Juli Mallett To: Alex Semenyaka Message-ID: <20030419205028.A78458@FreeBSD.org> References: <20030420011039.GC52081@snark.ratmir.ru> <20030420013400.GB52428@snark.ratmir.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20030420013400.GB52428@snark.ratmir.ru>; from alexs@ratmir.ru on Sun, Apr 20, 2003 at 05:34:00AM +0400 Organisation: The FreeBSD Project X-Alternate-Addresses: , , , , X-Towel: Yes X-Negacore: Yes X-Title: Code Maven X-Authentication-Warning: localhost: juli pwned teh intarweb cc: freebsd-standards@freebsd.org cc: Alex Semenyaka Subject: Re: /bin/sh and 32-bit arithmetics [CORRECTED] X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Apr 2003 01:50:29 -0000 * De: Alex Semenyaka [ Data: 2003-04-19 ] [ Subjecte: Re: /bin/sh and 32-bit arithmetics [CORRECTED] ] > ...ghmmm... sorry and sorry... and here the patch, it is pretty small: At a cursory glance: You are using quad_t (barf) formats for what is intmax_t, you really want to use %j not %q, and you may be doing more work than is necessary. Simply switching to "long" in place of "int" for everything (and LONG_ vs INT_) may be a better start than using intmax_t? intmax_t may be very slow, for some operations, and you may still have 128-bit intmax_t on a system with 64-bit long and 32-bit int, and 64-bit intmax_t on a system with 32-bit long and int, and 64-bit long long, thus an argument along the lines of "long makes the integer size gain a non-normalised thing" would be bogus, I think. A better argument might be for building i386 with 64-bit long (ha ha ha), and that seems what you want- a wider type on a sucky architecture ;) As for the INTMAX_LEN or whatnot, that's bogusish. There are ways of (at run time) deducing the maximum size of a buffer for a , probably you can shove them into some init routine that sh surely has. Also, I don't know how we feel about C++/C99 style comments in the base system. Thanx, juli (who imagines bde would have better advice.) -- juli mallett. email: jmallett@freebsd.org; aim: bsdflata; efnet: juli;