On Sat, May 5, 2012 at 11:33 AM, dexen deVries <dexen.devries@gmail.com> wrote:
On Wednesday 25 of April 2012 15:32:06 erik quanstrom wrote:
> also, in case you missed it sizeof(int)==sizeof(long)==4 on both 32
> and 64 bit plan 9, so recompiled programs won't get bigger integers
> just for the recompiling.


pardon silly question, but... why, on 64bit machine, P9 uses 32bit ints and
longs?

my impression is, int was supposed to match machine's preferred (best
performance etc.) integeral datatype, and long was supposed to be enough to
hold a pointer? (i.e., sizeof(long) >= sizeof(void*))


Re "supposed" if you mean according to say Standard C, no.  Even so-called K&R C was not black and white regarding this per se.  Standard C only provided minimum sizes.  Indeed, there is often preferences, but that's usually up to vendors, and lots of it yield *-defined behaviors.  As it should.

There is also the issue of that, if, you really want a 64-bit integer, then, using int is certainly moving towards a direction of a programming error, since int does not often yield such a beast, even on so-called systems which could provide it.  C99 provides for stuff such as int_least64_t for those who really need such.

--
Greg Comeau / 4.3.10.1 with C++0xisms now in beta!
Comeau C/C++ ONLINE ==>     http://www.comeaucomputing.com/tryitout
World Class Compilers:  Breathtaking C++, Amazing C99, Fabulous C90.
Comeau C/C++ with Dinkumware's Libraries... Have you tried it?