Date: Thu, 25 Oct 2007 00:55:54 -0500 From: Joshua Isom <jrisom@gmail.com> To: "Aryeh M. Friedman" <aryeh.friedman@gmail.com> Cc: RW <fbsd06@mlists.homeunix.com>, freebsd-questions@freebsd.org Subject: Re: forcing compilation/run time linking of lib32 on amd64 Message-ID: <36110e69e0c1fe9e49f742597d6a85a2@gmail.com> In-Reply-To: <471FF7E2.3010004@gmail.com> References: <471FAFD4.5090500@gmail.com> <20071025022632.72fd6283@gumby.homeunix.com.> <471FF7E2.3010004@gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Oct 24, 2007, at 8:56 PM, Aryeh M. Friedman wrote: > RW wrote: >> On Wed, 24 Oct 2007 16:49:24 -0400 >> "Aryeh M. Friedman" <aryeh.friedman@gmail.com> wrote: >> >> >>> I am writing some demo code (for teaching C) ... showing that >>> int's are always word length >>> >> >> s/always/typically/ >> >> C has been around for a long time and there is always a >> counter-example >> to any sweeping generalisation that isn't backed-up by a standards >> document. > > BTW I was slightly wrong it is longs not int's that change depending on > word size: > > Script started on Wed Oct 24 19:51:44 2007 > Just remember this, char <= short <= int <= long. Anything else can be anything. Saying that an int is always four bytes is like saying an int is the same size as a pointer, both of which are assumptions that are often taken but are very wrong. A lot of what decides the sizes of ints is more compiler implementer than anything else. Depending on your system, you'd want your 36 bit ints instead of being limited to only 32. But if you don't care about portability, then an int is always 32 bits and it's always in little endian order.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?36110e69e0c1fe9e49f742597d6a85a2>