Endless error loop in g++

ak@muc.de ak@muc.de
Tue May 19 02:55:00 GMT 1998


Hallo,

This simple program causes an endless error message loop in
gcc version egcs-2.91.13 980308 (gcc-2.8.0 release).

The program contains two typos so it should not compile, but the compiler
should not loop for ever. 



in xp_unabs(int base, int exp) 
{
	int res = base;
	whil (base > 0) { 
		res = res * base;
		base = base - 1;
	}
	return res;
}


% g++ errloop.cc
errloop.cc:1: warning: ANSI C++ forbids declaration `in' with no type
errloop.cc:1: parse error before `('
errloop.cc:4: `base' was not declared in this scope
errloop.cc:4: warning: ANSI C++ forbids declaration `whil' with no type
errloop.cc:4: syntax error before `{'
errloop.cc:4: warning: ANSI C++ forbids declaration `whil' with no type
errloop.cc:4: redefinition of `int whil'
errloop.cc:4: `int whil' previously defined here
errloop.cc:4: syntax error before `{'
errloop.cc:4: warning: ANSI C++ forbids declaration `whil' with no type
errloop.cc:4: redefinition of `int whil'
errloop.cc:4: `int whil' previously defined here
errloop.cc:4: syntax error before `{'
errloop.cc:4: warning: ANSI C++ forbids declaration `whil' with no type
errloop.cc:4: redefinition of `int whil'
errloop.cc:4: `int whil' previously defined here
.... repeats forever...

-Andi







	





More information about the Gcc-bugs mailing list