🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.lang.c
Article #8653

Re: C Compiler bug (and fix for a different one)

#8653
From: Ray Butterworth
Date: Fri, 25 Jul 1986 12:43
33 lines
1406 bytes
> >    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:
Technical Details
Message-ID: <273@watmath.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!watmath!rbutterworth
References: <501@bunny.UUCP> <500@copper.UUCP>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/18/84; site watmath.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!rbutterworth
From: rbutterworth@watmath.UUCP (Ray Butterworth)
Newsgroups: net.lang.c,net.bugs
Subject: Re: C Compiler bug (and fix for a different one)
Message-ID: <273@watmath.UUCP>
Date: Fri, 25-Jul-86 08:43:49 EDT
Article-I.D.: watmath.273
Posted: Fri Jul 25 08:43:49 1986
Date-Received: Sat, 26-Jul-86 05:46:51 EDT
References: <501@bunny.UUCP> <500@copper.UUCP>
Distribution: net
Organization: U of Waterloo, Ontario
Lines: 33