Date: Sat, 19 Apr 2003 20:50:29 -0500 From: Juli Mallett <jmallett@FreeBSD.org> To: Alex Semenyaka <alexs@ratmir.ru> Cc: Alex Semenyaka <alexs@snark.ratmir.ru> Subject: Re: /bin/sh and 32-bit arithmetics [CORRECTED] Message-ID: <20030419205028.A78458@FreeBSD.org> In-Reply-To: <20030420013400.GB52428@snark.ratmir.ru>; from alexs@ratmir.ru on Sun, Apr 20, 2003 at 05:34:00AM %2B0400 References: <20030420011039.GC52081@snark.ratmir.ru> <20030420013400.GB52428@snark.ratmir.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
* De: Alex Semenyaka <alexs@ratmir.ru> [ 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<qual> not %q<qual>, 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 <fooint>, 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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030419205028.A78458>