From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,148120d854994a80 X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1995-01-26 14:35:21 PST Path: pad-thai.cam.ov.com!bloom-beacon.mit.edu!news.kei.com!news.mathworks.com!udel!gatech!newsxfer.itd.umich.edu!caen!crl.dec.com!crl.dec.com!jac.zko.dec.com!motie.zko.dec.com!dmurphy From: dmurphy@motie.zko.dec.com (Dennis Murphy) Newsgroups: comp.unix.osf.osf1 Subject: Re: Short Program That Crashes CC (OSF 2.1 and OSF 3.0) Date: 26 Jan 1995 18:33:12 GMT Organization: Digital Equipment Corporation Distribution: world Message-ID: <3g8pt8$rkl@jac.zko.dec.com> References: <3g6ldq$gav@agate.berkeley.edu> Reply-To: dmurphy@tle.enet.dec.com NNTP-Posting-Host: motie.zko.dec.com X-Newsreader: mxrn 6.18-16 >Consider the following program fragment: > >extern char *foo(char *); > >void main() >{ > char *siteName[128] = foo("HELLO"); >} > >Compiling it on both OSF 2.1 and OSF 3.0 results in the following: > >% cc -c j.c >Assertion failed: (((((ty)->tree_common).code) == Struct_type) || ((((ty)->tree_common).code) == Longdouble_type && (bit_size[Target_LongDouble] == 128))), file ../../../../../../src/usr/ccs/bin/cfe/expr_cg.c, line 5270 >Fatal error in: /usr/lib/cmplrs/cc/cfe IOT/Abort trap Here are the results using the cc -migrate compiler... motie.zko.dec.com> cc -migrate -c t.c cc: Warning: t.c, line 5: In the initializer for siteName[0], "foo" is not const ant, but occurs in a context that requires a constant expression. This is an ex tension of the language. char *siteName[128] = foo("HELLO"); ------------------------------^ motie.zko.dec.com> more t.c extern char *foo(char *); void main() { char *siteName[128] = foo("HELLO"); }