Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!granite!tp From: tp@granite.dec.com (t patterson) Newsgroups: comp.lang.c Subject: Re: AT&T C compilers (type of 'x') Keywords: reality-check Message-ID: <413@granite.dec.com> Date: 3 Mar 89 04:33:32 GMT References: <569@marob.MASA.COM> <1071@auspex.UUCP> <1109@wpi.wpi.edu> <774@masscomp.UUCP> <9774@smoke.BRL.MIL> Reply-To: tp@decwrl.dec.com (t patterson) Organization: DEC WSE, Palo Alto, Ca Lines: 39 In article <9774@smoke.BRL.MIL> gwyn@brl.arpa (Doug Gwyn ) writes: >In article <774@masscomp.UUCP> ftw@quasar.masscomp.UUCP (Farrell Woods) writes: >>Go stand in the corner with those who still think 'x' is an int. > >What IS this, anyway? 'x' IS an int. well, if some of you guys aren't going to believe Doug Gwyn and Chris Torek, will you belive your own C compiler? following is a script testing pcc, gcc 1.31, and vcc (DEC's own) on Ultrix 2.2: (apologies for the quickie C program...) Script started on Thu Mar 2 20:20:30 1989 granite [51] cat xint.c main() { printf("size is: %d\n", sizeof('x') ); } granite [52] cc xint.c granite [53] a.out size is: 4 granite [51] gcc -v gcc version 1.31 granite [52] gcc xint.c granite [53] a.out size is: 4 granite [54] vcc xint.c granite [55] a.out size is: 4 granite [56] script done on Thu Mar 2 20:21:18 1989 hmm... either 'x' is an "int" or a lot of compiler writers are wrong. (or "sizeof(char)" was suddenly and unexpectedly given a promotion.) -- t. patterson domain: tp@decwrl.dec.com path: decwrl!tp icbm: 122 9 41 W / 37 26 35 N % opinions herein are mine alone and certainly not those of DEC