[Coco] Alternate O-9/itrOS-9 C Compiler

Lothan lothan at newsguy.com
Tue May 21 00:40:29 EDT 2013


From: Willard Goosey

> Yeah, It was obviously not a commonly tripped-over bug or it would
> have been fixed earlier.  Let me know if you find valid C that c_prep
> fails on.

I think I just found a bug in comp_06.c that only affects the C compiler on 
non-CoCo systems. In the L34d9 function, scroll down to the case C_MULT 
section and you'll see this code:

if(((cref->cr_Right)->vartype) == C_LONG)
{
#ifdef COCO
     var4 = ((CMDREF *) (cref->cr_Right)->cmdval);
     ...
#else
     long _lval = ((long) (cref->cr_Right)->cmdval);

     if((_lval <= 0xffff) && (valptr = shftcount(var4->varsize)))
#endif

The issue is that the code initializes _lval to a long, but var4 is never 
initialized in the non-CoCo case.

It looks as if the first statement that initializes var4 should be pulled up 
above the #ifdef COCO statement.




More information about the Coco mailing list