This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/29642] New: Fortran 2003: VALUE Attribute (call by value not call by reference for actual arguments)


This is already supported by a large number of compilers (e.g. sunf95, NAG f95,
ifort, g95).

gfortran gives: Syntax error in data declaration

Example:
subroutine foo(i)
 implicit none
 integer, value :: i
 print *, i
end subroutine foo

>From the Fortran 2003 standard:

"5.1.2.15 VALUE attribute
The VALUE attribute specifies a type of argument association (12.4.1.2) for a
dummy argument."

And in
"12.4.1.2 Actual arguments associated with dummy data objects"

"If the dummy argument has the VALUE attribute it becomes associated with a
definable anonymous data object whose initial value is that of the actual
argument. Subsequent changes to the value or definition status of the dummy
argument do not affect the actual argument."

"NOTE 12.22
Fortran argument association is usually similar to call by reference and call
by value-result. If the VALUE attribute is specified, the effect is as if the
actual argument is assigned to a temporary, and the temporary is then argument
associated with the dummy argument. The actual mechanism by which this happens
is determined by the processor."


-- 
           Summary: Fortran 2003: VALUE Attribute (call by value not call by
                    reference for actual arguments)
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29642


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]