Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!rutgers!ll-xn!husc6!hao!scdpyr!cruff From: cruff@scdpyr.UUCP (Craig Ruff) Newsgroups: comp.lang.c Subject: Re: C machine Message-ID: <253@scdpyr.UUCP> Date: 30 Dec 87 15:12:03 GMT References: <7535@alice.UUCP> <8226@steinmetz.steinmetz.UUCP> <461@auvax.UUCP> <163@bhjat.UUCP> <9961@mimsy.UUCP> <1987Dec28.163403.24137@sq.uucp> Reply-To: cruff@scdpyr.UUCP (Craig Ruff) Organization: Natl Ctr Atmospheric Research, Boulder, CO Lines: 32 In article <1987Dec28.163403.24137@sq.uucp> msb@sq.UUCP (Mark Brader) writes: > >On the topic of of short/int/long, Chris Torek (chris@mimsy.UUCP) writes: >> Nope. The dpANS says only that short >= 16 bits, int >= 16 bits, and >> long >= 32 bits. > >This is misleading in the context; the dpANS *also* says that short <= int >and int <= long. So the method adopted by a 64-bit machine in the past, >where long = 32 bits "because that's what everybody assumes", and >int = 64 bits "because that's the natural size", would be non-conforming. Here is the scoop on some Cray machines. All numbers are in bits, in the format precision(memory), where memory = amount of memory to store item. Cray-1, Cray X-MP Cray-2 ----------------- ------------ char 8(8) 8(8) int 64(64) 32(64) short 24(64) 32(64) long 64(64) 64(64) float 64(64) 64(64) double 64(64) 64(64) char * 64(64) 64(64) other * 24(64) 24(64) Note that these are the not-all-pointers-are-alike machines, and pointers cannot always be converted to ints and back again. Character pointers are stored as a 24 bit word address and a 3 bit offset (in the most significant bits). -- Craig Ruff NCAR INTERNET: cruff@scdpyr.UCAR.EDU (303) 497-1211 P.O. Box 3000 CSNET: cruff@ncar.CSNET Boulder, CO 80307 UUCP: cruff@scdpyr.UUCP