Patch for %VAL issue

Tobias Burnus burnus@net-b.de
Tue Dec 5 12:55:00 GMT 2006


Hi,

Pierre Moinier wrote:
> I have read from Bugzilla that, on the 14/11, a patch to solve the
> %VAL issue would be submitted. I am currently running gcc version
> 4.1.1 20060525, but I still can not compile my code. Where can I find
> the patch?

(PR23060) This has not yet been committed, yet.* Besides, I think this
patch will be submitted to 4.3 only, maybe also to 4.2, but I think not
to 4.1. (*actually, there is not even a finished patch.)

If you write your own code, you might consider using the Fortran 2003
VALUE attribute/statement, which effectively does the same as %VAL( )
but uses a completely different syntax. VALUE is implemented in several
newer compilers, including gfortran 4.3.
Contrary to %VAL()  VALUE is defined in a standard and has a unique
definition.

%VAL() is a vendor extension, which is implemented in several compilers,
but not necessarily consistently. Especially, there is a difference
between VMS/VAX/DEC and g77, which still has to be sorted out (cf. 
http://gcc.gnu.org/ml/fortran/2006-11/msg00475.html).

 * * *

VMS/VAX/DEC/IBM support %VAL and %REF to pass an argument as value or as
reference; the difference between %REF and the default passing is that
for strings %REF does not pass the string and its length, but only the
string (which should be null terminated). cf. e.g.
http://publib.boulder.ibm.com/infocenter/comphelp/v8v101/topic/com.ibm.xlf101a.doc/xlflr/argument_association.htm#valint

g77 supports %VAL, %REF and %DESC to pass as value, reference and as
descriptor, but I do not completely understand what is passed how :-(
http://gcc.gnu.org/onlinedocs/gcc-3.4.4/g77/Functions-and-Subroutines.html#Functions-and-Subroutines

Tobias



More information about the Fortran mailing list