C Compiler bug (and fix for a different one)

Ray Butterworth rbutterworth at watmath.UUCP
Fri Jul 25 22:43:49 AEST 1986


> >    i = i/2.5;
> vs.
> >    i /= 2.5;

So, does anyone have a fix for this bug?
I'll trade for a fix for a problem with void functions and the ?: operator.

void f3(which)
{
    extern void f1(),f2();
    which?f1():f2();
}
cc(1) gives an "incompatible types" error.


In /usr/src/lib/mip/trees.c add the line indicated by "->>".
This lets the above code lint and compile ok (and I don't think it causes
any new problems).

...
opact( p )  NODE *p; {
...
    switch( optype(o=p->in.op) ){
...
        case COLON:
            if( mt12 & MENU ) return( NCVT+PUN+PTMATCH );
            else if( mt12 & MDBI ) return( TYMATCH );
...
            else if( mt12 & MSTR ) return( NCVT+TYPL+OTHER );
->>         else if ( (!mt1) && (!mt2) ) return TYPL;
            break;

        case ASSIGN:



More information about the Comp.lang.c mailing list