chris@umcp-cs.UUCP (Chris Torek) (08/29/84)
More ways to break PCC: f()char *f;{return 1;} /* no complaints!? */ f()char *f;{return "";} /* "illegal comb. of ops, op RETURN" */ f(i);f(j){return j;} /* no complaints; `j' accessed via 8(ap) */ f(i);i(f);{ /* "compiler takes alignment of function" */ -- In-Real-Life: Chris Torek, Univ of MD Comp Sci (301) 454-7690 UUCP: {seismo,allegra,brl-bmd}!umcp-cs!chris CSNet: chris@umcp-cs ARPA: chris@maryland
chris@umcp-cs.UUCP (Chris Torek) (08/29/84)
Oops, I forgot one: f()char *f;{char *p=f; /* "bad arg temp" */ -- In-Real-Life: Chris Torek, Univ of MD Comp Sci (301) 454-7690 UUCP: {seismo,allegra,brl-bmd}!umcp-cs!chris CSNet: chris@umcp-cs ARPA: chris@maryland
donn@utah-cs.UUCP (Donn Seeley) (08/30/84)
Even more fun... The following program shows how to declare arguments in a unique way: ------------------------------------------------------------------------ double x( a ), y( b ), z( c ); double d() double a, b, c; { return a + b + c; } ------------------------------------------------------------------------ A similarly obscene program produces the plaintive warning 'bad arg temp': ------------------------------------------------------------------------ double x(), y(), z(); double d() double x, y, z; { return x + y + z; } ------------------------------------------------------------------------ PCC has almost as many bugs as the C-shell, Donn Seeley University of Utah CS Dept donn@utah-cs.arpa 40 46' 6"N 111 50' 34"W (801) 581-5668 decvax!utah-cs!donn