AT&T C compilers (type of 'x')

t patterson tp at granite.dec.com
Fri Mar 3 14:33:32 AEST 1989


In article <9774 at smoke.BRL.MIL> gwyn at brl.arpa (Doug Gwyn <gwyn>) writes:
>In article <774 at masscomp.UUCP> ftw at 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 at 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



More information about the Comp.lang.c mailing list