This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
option to check that arguments to PACK conform?
- From: Vivek Rao <vivekrao4 at yahoo dot com>
- To: fortran at gcc dot gnu dot org
- Date: Wed, 8 Nov 2006 11:10:08 -0800 (PST)
- Subject: option to check that arguments to PACK conform?
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=cRfQVL7XpgVrcP5tgl0AWa/zEHtYJEr0AC66FiNWwAFwajfA2qVqkf6KIeVVnUPeugtezhqMxRYbfkD4h+1ovlldYO7UVw1PZExQVPMMRYKhLta9uLZMD1GlP6WPVzWjZMAat2WLZgFpfH80WfRn/rwU6YsV9wZTg0HDXkUoJrw= ;
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