option to check that arguments to PACK conform?
Vivek Rao
vivekrao4@yahoo.com
Wed Nov 8 20:55:00 GMT 2006
For the code
program xpack
! check if compilers catch non-conforming array
arguments for pack
implicit none
integer :: n
integer, allocatable :: ivec(:)
logical, allocatable :: tf(:)
n = 2
allocate (ivec(n),tf(n+1))
tf = .true.
ivec = (/10,20/)
print*,pack(ivec,tf)
end program xpack
gfortran -Wall -fbounds-check xpack_bounds.f90
using gcc version 4.3.0 20061021 (experimental)
gives output
10 20
and does not complain at run-time about the
nonconformable array arguments to PACK. If there is no
option that catches this, I request that one be added.
I know there are more pressing tasks for gfortran
developers, and I can enter the request in bugzilla
myself if the functionality does not currently exist.
I wonder if there are other Fortran 95 array intrinsic
functions for which nonconforming arrays are not
caught.
Vivek Rao
More information about the Fortran
mailing list