Path: utzoo!mnetor!uunet!mcvax!steven
From: steven@cwi.nl (Steven Pemberton)
Newsgroups: comp.sys.atari.st
Subject: Re: Alcyon C Bug N++
Message-ID: <140@piring.cwi.nl>
Date: 7 Dec 87 14:59:48 GMT
References: <8712051307.AA12109@ucbvax.Berkeley.EDU>
Reply-To: steven@cwi.nl (or try mcvax!steven.uucp)
Organization: CWI, Amsterdam
Lines: 38

For people interested, here are a couple of bugs in the Alcyon
compiler that we've been hitting our heads against for the last few
weeks:

	1) The compiler doesn't seem able to cope with nested
	   initialisations. For instance, a struct with an array in
	   the middle:
		static struct foo table[] = {
			{ ...... {.....} ......},
			...
		}
	   The compiler complains about mismatched braces.
	   Cure: 'unwrap' the struct declaration, so it's all at the
		 same level.

	2) In a construct like
		bar *p = (expression1, expression2);
	   the result of expression2 gets coerced to int, and then
	   back to bar *, meaning basically that you get bombs on the
	   screen when you try to use p, due to a wrong address.
	   Cure: use
		bar *p = (expression1, (bar *) expression2);

	3) We believe that 'complicated' initialisations to auto
	   variables in functions (for instance where the
	   initialisation involves a call to another function) often
	   come out wrong. However, by this point, we despaired, and
	   stopped using the compiler, so we never followed up on it.

I might point out that we're trying to compile a BIG program: 30,000
lines of C, so just trying to trace bug 2 took us a LOT of time.

By the way, just for interest: to compile the lot from scratch, using
a ram disk for temporaries would take 4 hours. When we reinitialised
the disk partition, and copied the files back, a recompile only took
1.5 hours!

Steven Pemberton, CWI, Amsterdam; steven@cwi.nl