nonportable code or incorrect compilers?

John F Carr jfc at athena.mit.edu
Tue Jul 12 11:44:52 AEST 1988


In article <376 at accelerator.eng.ohio-state.edu> 
rob at kaa.eng.ohio-state.edu (Rob Carriere) writes:

>Whoops.  You didn't see it because it isn't there, I *did* mean
>conversion.  However, the conversion rule says that a is to be
>converted to double; this seems to contradict the idea that a is to be
>computed *once*.

I thought the purpose of the definition was so that things like subscripts
and function calls needed to compute the lhs would not be repeated:

 a[f(x++) + --y] += 43;

has different results than

 a[f(x++) + --y]  =  a[f(x++) + --y] + 43;

To make this consistent with the standard, distinguish between "evaluation"
and the type conversions required in computation.

   John Carr             "When they turn the pages of history,
   jfc at Athena.mit.edu     When these days have passed long ago,
                          Will they read of us with sadness
                          For the seeds that we let grow?"  --Neil Peart



More information about the Comp.std.c mailing list