[comp.lang.c] gcc/cc difference

roland@cochise.pcs.com (Roland Rambau) (06/28/90)

maart@cs.vu.nl (Maarten Litmaath) writes:

->)>>>	mflag ? *buf++ -=mean.median : Mflag ? *buf++
->)>>>	    -=mean.mode : *buf++ -=mean.mean;

->The expression is of this form:

->	a ? b : c = d;

->The illegal lvalue is:

->	a ? b : c

->(sic)!  The `?:' operator has a higher priority than the various assignment
->operators.  The following does what was intended:

->	a ? b : (c = d);

What really was intended is

        *buf -= mfag ? mean.median : Mfalg ? mean.mode : mean.mean ;
        buf += 3 ;

( Or did I get this wrong, and the original does NOT increment tree times ? )


Roland Rambau

  rra@cochise.pcs.com,   {unido|pyramid}!pcsbst!rra,   2:507/414.2.fidonet