[prev in list] [next in list] [prev in thread] [next in thread]
List: gcc-fortran
Subject: Documentation update? gfortran return the size of an assumed-rank dummy argument
From: Damian Rouson <damian () sourceryinstitute ! org>
Date: 2015-10-29 18:22:37
Message-ID: 24EBD6BE-2357-4585-8C04-30406206718E () sourceryinstitute ! org
[Download RAW message or body]
All,
The transcript below shows that gfortran returns 1 for the size of an assumed-rank \
dummy argument associated with a scalar actual argument, which is the behavior I had \
hoped to see. I assume this means the following documentation needs to be updated to \
reflect that the first argument to SIZE need be an array (unless an assumed-rank \
dummy argument is classified as an array):
https://gcc.gnu.org/onlinedocs/gfortran/SIZE.html
$ cat size-assumed-rank.f90
program main
implicit none
real :: a
call foo(a)
contains
subroutine foo(x)
real, intent(in) :: x(..)
print *,size(x)
end subroutine
end program
$ gfortran size-assumed-rank.f90
n$ ./a.out
1
localhost:Desktop rouson$ gfortran --version
GNU Fortran (MacPorts gcc6 6-20151018_0) 6.0.0 20151018 (experimental)
________________________________
Damian Rouson, Ph.D., P.E.
President, Sourcery Institute
http://www.sourceryinstitute.org
+1-510-600-2992 (mobile)
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic