This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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]

option to check that arguments to PACK conform?


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


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