PCC bugs

joemu at tekecs.UUCP joemu at tekecs.UUCP
Wed Oct 31 03:50:18 AEST 1984


Don Seely (sp?) asked a while back for some "programs" that will cause PCC
to core dump. He originally stated that he wanted to start a contest to find
the shortest program that would core dump the compiler.

What I would ask is that we forget about this type of "contest" and
concentrate on finding and fixing bugs. I applaud Don's activities on the
f77 compiler and would be more than happy to see him set up something
similar to it for pcc. I would like to see all types of bugs reported,
not just "core dumpers".


Here are a couple bugs that come to mind.

------------------------------------------------------------------------
This causes cpp to core dump on many systems:

#if 1/0
#endif

------------------------------------------------------------------------
This causes ccom to die on many systems:

char foo[-1];	/* the -1 turns into a huge number */
------------------------------------------------------------------------
This causes ccom to generate bogus instructions on the vax:

float foo;	/* double works just as well */

foo++;	/* the infamous incf instruction */
foo--;	/* the infamous decf instruction */

predecrement and preincrement work just as well.
------------------------------------------------------------------------
The scope of typedef's is screwed on most systems:
Typedefs should behave as ordinary identifiers (i.e. they can be
redeclared in inner blocks). Most compilers handle typedefs as
global identifiers independent of scoping rules. Try the fragment of
code from K&R pp. 206

typedef float distance;
...
{
	auto int distance;
	...
This generates a syntax error on many implementations.
------------------------------------------------------------------------

I hope this gets us off to a better start. Keep up the great work
Don!


				Joe Mueller

UUCP:	...!{ucbvax or decvax}!tektronix!tekecs!joemu
ARPA:	tekecs!joemu.tektronix @ udel-relay



More information about the Comp.lang.c mailing list