🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.bugs.misc
Article #122

PCC and char x[]={sizeof("abc")};

#122
From: Ray Butterworth
Date: Fri, 27 May 1988 16:39
15 lines
796 bytes
For some reason, tsize() in mip's pftn.c is called with garbage
arguments when the type of the array is (char).  The other types
seem to work correctly.


% cat xx.c
int  x[] = { sizeof("abc") };
long y[] = { sizeof("abc") };
char z[] = { sizeof("abc") };

BSD% cc xx.c
"xx.c", line 3: compiler error: compiler takes size of function

SUN% cc xx.c
cc: Fatal error in /lib/ccom: Segmentation fault (core dumped)
Technical Details
Message-ID: <19100@watmath.waterloo.edu>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!husc6!mailrus!ames!umd5!purdue!decwrl!decvax!watmath!rbutterworth

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!husc6!mailrus!ames!umd5!purdue!decwrl!decvax!watmath!rbutterworth
From: rbutterworth@watmath.waterloo.edu (Ray Butterworth)
Newsgroups: comp.bugs.misc
Subject: PCC   and   char x[]={sizeof("abc")};
Message-ID: <19100@watmath.waterloo.edu>
Date: 27 May 88 16:39:30 GMT
Distribution: comp
Organization: U of Waterloo, Ontario
Lines: 15