kirkaas@oahu.cs.ucla.edu (paul kirkaas) (03/26/89)
The following code produces the indicated error when compiling on the 3b1.
I believe the expression in question is legal C; and it compiles OK on
a Sun.
------------------------------------------------------------------------
struct dstr {double x;};
struct istr {int i;};
main()
{
struct dstr ds,*dsP;
struct istr is,*isP;
dsP = &ds;
isP = &is;
ds.x--; /* OK */
isP->i--; /* OK */
dsP->x--; /* "tst.c", line 11: compiler error: allocation fails, op STAR */
}
Paul Kirkaas
kirkaas@cs.ucla.edu
guy@auspex.UUCP (Guy Harris) (03/27/89)
>The following code produces the indicated error when compiling on the 3b1. >I believe the expression in question is legal C; and it compiles OK on >a Sun. Yes, it's legal. It's definitely a compiler bug; any message that begins with "compiler error" - from a PCC-based compiler, at least - is *ipso facto* a sign of a compiler bug - that's what "compiler error" means! (Even if the construct were incorrect, an error message saying "compiler error" indicates a compiler bug, if for no other reason than the fact that it indicates that the incorrect construct isn't being properly checked for or diagnosed, or that the compiler writer thought it was impossible, and thus the compiler discovered something happened that the compiler writer thought "should never happen"....)