Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!uwvax!umnd-cs!umn-cs!pogo!abh From: abh@pogo.cray.com (Andy Hastings) Newsgroups: comp.unix.wizards,comp.lang.c Subject: Re: compiler predefines Message-ID: <351@pogo.cray.com> Date: Mon, 27-Jul-87 14:58:30 EDT Article-I.D.: pogo.351 Posted: Mon Jul 27 14:58:30 1987 Date-Received: Thu, 30-Jul-87 03:38:12 EDT References: <521@quacky.UUCP> <526@quacky.UUCP> <23741@sun.uucp> <865@bsu-cs.UUCP> Organization: Cray Research, Inc., Mendota Heights, MN Lines: 31 Summary: change to `mch' for large word sizes Xref: mnetor comp.unix.wizards:3463 comp.lang.c:3347 In article <865@bsu-cs.UUCP>, dhesi@bsu-cs.UUCP (Rahul Dhesi) writes: > This program emits C #define statements to the standard output describing > the machine it is executing on. The following #defines are generated: > Mch_Csz - size of a char, in bits > Mch_Ssz - size of a short int, in bits > Mch_Isz - size of a plain int, in bits > Mch_Lsz - size of a long int, in bits > Mch_BE - defined if the machine is big-endian; that is, if > the most significant byte in a number appears first. > Mch_LE - defined if the machine is little-endian; that is, if > the least significant byte in a number appears first. > Mch_PDP - defined if the machine uses PDP-11 byte ordering; > LE for bytes-in-a-word and BE for words-in-a-long. > Mch_ONE - defined if the machine uses one's complement arithmetic. > Mch_sgc - defined if characters can be signed. Hmm. The program said `mch: bogus byte size' when I ran it on my CRAY X-MP. I changed the definition of bittest to: char bittest[9] = "\001\001\001\001\001\001\001\001"; and then I got the correct results: #define Mch_Csz 8 #define Mch_Ssz 64 #define Mch_Isz 64 #define Mch_Lsz 64 #define Mch_BE 1 Much better. -Andy Hastings ihnp4!cray!hall!abh Cray Research, Inc. sun!tundra!hall!abh *CRAY X-MP is a trademark of Cray Research, Inc.