Path: utzoo!attcan!uunet!munnari!otc!softway!chris From: chris@softway.oz (Chris Maltby) Newsgroups: comp.bugs.misc Subject: Re: PCC and char x[]={sizeof("abc")}; Summary: Another PCC special case misfires Message-ID: <366@softway.oz> Date: 30 May 88 06:07:09 GMT References: <19100@watmath.waterloo.edu> Distribution: comp Organization: Softway Pty Ltd, Sydney, Australia Lines: 26 In article <19100@watmath.waterloo.edu> rbutterworth (Ray Butterworth) writes: > % 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 DYNIX% cc x.c "xx.c", line 3: unknown size It's being real smart, and assuming you want to initialise the char array with "abc". Then it sees the sizeof - spew! A workaround is: char _z[] = "abc"; char z[] = { sizeof _z }; I guess the actual fix is to find the spot where it starts the initialisation and stop it from screwing up. -- Chris Maltby - Softway Pty Ltd (chris@softway.oz) PHONE: +61-2-698-2322 UUCP: uunet!softway.oz!chris FAX: +61-2-699-9174 INTERNET: chris@softway.oz.au