This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Endless error loop in g++


ak@muc.de said:
> 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;
> }

I'm getting (somewhat) reasonable error messages with 19980517 and the same
with 19980508 (in run from latest drivers) on sparc-sun-solaris2.5.1:

 vonbrand@pincoya$ gcc err.c 
 err.c:1: parse error before `xp_unabs'
 err.c: In function `xp_unabs':
 err.c:4: parse error before `{'
 err.c: At top level:
 err.c:8: parse error before `return'
 vonbrand@pincoya$ g++ err.c 
 err.c:1: syntax error before `('
 err.c:4: `base' was not declared in this scope
 err.c:4: warning: ANSI C++ forbids declaration `whil' with no type
 err.c:4: syntax error before `{'
 err.c:6: warning: ANSI C++ forbids declaration `' with no type
 err.c:6: abstract declarator `int' used as declaration
 err.c:6: `base' was not declared in this scope
 err.c:7: parse error before `}'

-- 
Dr. Horst H. von Brand                       mailto:vonbrand@inf.utfsm.cl
Departamento de Informatica                     Fono: +56 32 654431
Universidad Tecnica Federico Santa Maria              +56 32 654239
Casilla 110-V, Valparaiso, Chile                Fax:  +56 32 797513


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]