[Patch, fortran] PR29642 - Fortran 2003: VALUE Attribute (pass by value)

FX Coudert fxcoudert@gmail.com
Sat Nov 18 10:41:00 GMT 2006


>>> +     if ((a%x /= b%x) .or. (a%c /= b%c)) dtne = .TRUE.
>>> +   if (r /= 42.0) call abort ()
>>> +   if (z /= (-99.0, 199.0)) call abort ()
>>> +     if (r /= 42.0) call abort ()
>>> +     if (r /= 99.0) call abort ()
>>> +     if (z /= (-99.0, 199.0)) call abort ()
>>> +     if (z /= (77.0, -42.0)) call abort ()
> Please replace the real/complex tests by something like
>     abs(a%x-b%x) > epsilon(a%x)
> etc. Here it accidentally works, though.

I have to say that I differ here. There's no arithmetic done on the  
variables here, so the values should really be exactly the same, and  
a simple /= operator is, IMHO, sufficient.

Thanks Tobias for reviewing Paul's patch,
FX



More information about the Fortran mailing list