This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
what is the option I am looking for?
- From: Kamaraju Kusumanchi <kamaraju at gmail dot com>
- To: gfortran <fortran at gcc dot gnu dot org>
- Date: Thu, 31 Mar 2005 18:17:54 -0500
- Subject: what is the option I am looking for?
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding; b=lnilUAAK2/sBzw51+WBI4q5NeRQ/9N9s78MFcF+PTEqz25Ds4GmuzEVE/YRVQ8HShHTqlfHAOB3697CH5D7A8kO7ENFAM5fxT8eUl1GW0h3VIxdX4qdPkFTlZrwggWWwIt0Ifua+gigWn4/dbzDAfPSKZU9QisKczGj79yS7wVI=
- Reply-to: Kamaraju Kusumanchi <kamaraju at gmail dot com>
Hi
May be this is a stupid question. I have a bad code and I want
gfortran to flag an error whenever I use such construction. I dont
know what option I have to use so that gfortran catches it either at
runtime or compile time. Can someone help me?
$car test2.f90
module dummy
implicit none
real, allocatable :: gen(:)
contains
subroutine does_it_work(temp)
implicit none
real :: temp(1:5)
! This is not good code. But let's see what actually happens.
write(*,*) size(temp)
end subroutine does_it_work
end module dummy
program test
use dummy
implicit none
call does_it_work(gen)
end program test
$gfortran -Wall -fbounds-check test2.f90
$./a.out
5
A good compiler should point out that 'gen' is an unallocated array
and calling its size does not make any sense.
thanks in advance
raju
--
Kamaraju S Kusumanchi
http://people.cornell.edu/pages/kk288/