[net.bugs.4bsd] egregious C compiler bug

thomas (02/25/83)

Just encountered this one the other day (not my code, a friend came up
with it).  I don't know if it's in all C compilers, we're using the
(Berkeley) pcc.  Try the following program:

	main()
	{
		bar( 1, 2, 3, 4 );
	}

	/*  You can't call this one */
	foo( a, b );

	/* This one gets ALL 4 args! */
	bar( c, d )
	{

		printf("a=%d, b=%d, c=%d, d=%d\n", a, b, c, d);
	}

If you run it, it prints
	a=1, b=2, c=3, d=4

and the function foo is NOT defined!

=Spencer