[comp.sys.amiga.tech] Bug: lc1 HANGS with bad input

shs@uts.amdahl.com (Steve Schoettler) (04/15/89)

OK.  Here's the simple case:

------------------------

#define y(a)    2*a

myfunc(y)
char *y
{
	return(0);
}

----------------------

Note that I forgot the semi-colon after "char *y".  If you add the
semi-colon, everything compiles as expected.  If you remove the
#define, lc1 warns about a missing semi-colon.

This program as-is, hangs when compiled with "lc1 test", where
test.c is the program above and lc1 is version 5.02.  In case
you're wondering, my stack size is 50000.

I admit it's probably bad practice to use variable names that clash
with #define'd functions, but a compiler should never hang, no matter
how stupid the programmer is.


-- 

        Steve Schoettler
        shs@uts.amdahl.com
        {sun,decwrl,pyramid,ames,uunet}!amdahl!shs
        Amdahl Corp., M/S 213, 1250 E. Arques Ave, Sunnyvale, CA 94088