[net.bugs.4bsd] Another fun C bug

chris@eneevax.UUCP (12/05/83)

While hacking today I accidently broke a C function.  Did the compiler
complain?  Yes, but not in the expected way!

Here's a (very) condensed demo of the bug.
bug.c:

	int bug[10];

	bug1 (t) int bug; {
	    int s = bug;
	}

As you can see, bug1 incorrectly declares "bug" as an argument, while
the arglist inside parens lists 't'.  Instead of griping, the compiler
quietly accepts it!  However, as soon as one tries to access 'bug',
it generates a "warning:  bad arg temp".  Indeed, the code generated
has something bizarre in it.

Any pcc wizards know how to fix this?
--
Chris Torek, UMCP CS Dept
UUCP:	umcp-cs!chris	ARPA: chris@maryland	CSNET: chris@umcp-cs