Mailing List ArchiveSupport open source code!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]tlug: 64 bit int
- To: Darren Cook <darren@example.com>
- Subject: tlug: 64 bit int
- From: "Stephen J. Turnbull" <turnbull@example.com>
- Date: Tue, 20 Oct 1998 17:32:45 +0900 (JST)
- Cc: tlug@example.com
- Content-Transfer-Encoding: 7bit
- Content-Type: text/plain; charset=us-ascii
- In-Reply-To: <3.0.6.32.19981020165209.00973830@example.com>
- References: <Pine.LNX.3.96LJ1.1b7.981020132540.20295A-100000@example.com><13868.4127.240351.98727@example.com><3.0.6.32.19981020165209.00973830@example.com>
- Reply-To: tlug@example.com
- Sender: owner-tlug@example.com
>>>>> "Darren" == Darren Cook <darren@example.com> writes: >> For practical purposes (ie, working with existing code), int is >> 32 bits. Architectures with 64 bit ints do exist, of course >> (Alpha and I believe UltraSparc come to mind; purging ports of >> the int = 32 bits assumption is a regular complaint of Alpha >> programmers) Darren> I write lots of code with the assumption that short is 16 Darren> bits and int and long are 32 bits. Doesn't gcc have "long Darren> long" for 64-bit integers? Darren> What is the portable-to-64 way of referring to 16 and 32 Darren> bit integers? AFAIK there isn't one. Last I looked (a long time ago; ANSI standard was still "draft"), the standard says only 8 <= char <= short <= int <= long and 32 <= long and "long long" is a GCC extension. Where it matters (mostly "on the wire", ie, in the network protocols themselves) X11 uses its own types like CARD8, CARD16, and CARD32 to guarantee specific sizes. These are then conditionally included like this #ifdef ArchitectureX86 typedef unsigned char CARD8 typedef unsigned short int CARD16 typedef unsigned int CARD32 #elsif ArchitectureM68xxx (the actual strategy used is more complex). Linux itself uses __u8, __s32, and the like (as well as abbreviations without the leading `__', but _only_ in the kernel); see /usr/include/asm/types.h. Try comparing the versions in /usr/src/include/asm-alpha/types.h and /usr/src/include/asm-i386/types.h. (Oops, turns out that on Alpha an int is 32 bits; in 64-bit compilers, long and long long are 64 bits, on 32-bit compilers, long long is 64, but long is 32.) -- University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN Institute of Policy and Planning Sciences Tel/fax: +1 (298) 53-5091 __________________________________________________________________________ __________________________________________________________________________ What are those two straight lines for? "Free software rules." --------------------------------------------------------------- Next Nomikai: 20 November, 19:30 Tengu TokyoEkiMae 03-3275-3691 Next Meeting: 12 December, 12:30 Tokyo Station Yaesu central gate --------------------------------------------------------------- Sponsor: PHT, makers of TurboLinux http://www.pht.co.jp
- References:
- Re: tlug: kanji or romaji for Japanese? (was: parallel-port IDE)
- From: Scott Stone <sstone@example.com>
- Re: tlug: kanji or romaji for Japanese? (was: parallel-port IDE)
- From: "Stephen J. Turnbull" <turnbull@example.com>
- tlug: 64 bit int
- From: Darren Cook <darren@example.com>
Home | Main Index | Thread Index
- Prev by Date: tlug: CODA distributed filesystem
- Next by Date: tlug: CODA distributed filesystem
- Prev by thread: tlug: 64 bit int
- Next by thread: Re: tlug: kanji or romaji for Japanese? (was: parallel-port IDE)
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links