funny error
Eddie Wyatt
edw at IUS1.CS.CMU.EDU
Fri Mar 25 02:32:42 AEST 1988
I got an interesting error message today from the SUN compiler:
/bin/cc -I. -I/usr/misc/.matrix/include -f68881 -pipe -I/usr/wyatt/include -g -c net.c
"net.c", line 400: yacc stack overflow
*** Error code 1
Stop.
-------------------------------------------------------------------------
I have the macro def:
#define matinvert(xxx) do { errno = 0; \
matinvert(xxx); \
if (errno) \
printf("ERROR - in matinvert"); \
} while (0)
Line 400 has the first occurance of this macro.
Well it seems that I'm not allow to use the macro's name within the
macro definition (the C compile interprets it as a recusive macro).
However, somehow the above macro sufficiently confused the compiler.
If I use the -E switch the compiler is able to determine that the
definition is recursive. Oh well, just thought I would share in the
experience.
BTW: Sun's cc is written using yacc, I didn't know that til now.
--
Eddie Wyatt e-mail: edw at ius1.cs.cmu.edu
More information about the Comp.lang.c
mailing list