segmentation fault with gfortran
THOMAS Paul Richard 169137
prthomas@drfccad.cea.fr
Thu Oct 13 10:45:00 GMT 2005
FX,
Your example has an error in it:
program testsuite
real xco(3) ! This dimension was 2 => mismatch with func2
xco = func2(2)
print *, xco
contains
!---------------------------------------------------------------------------
---
function func1(N)
implicit none
real :: func1(0:N)
integer, intent(in) :: N
func1(:) = 1.0
end function func1
!---------------------------------------------------------------------------
---
function func2(N)
implicit none
real :: func2(0:N)
integer, intent(in) :: N
func2(:) = 1.0 + func1(N)
end function func2
end program testsuite
with that correction this example compiles and runs, as does the original.
$ /irun/bin/gfortran -v
Using built-in specs.
Target: i686-pc-cygwin
Configured with: ../gcc/configure --with-gmp=/usr/local/gmp
--with-mpfr=/usr/loc
al/gmp --prefix=/irun --enable-languages=c,fortran,c++ : (reconfigured)
../gcc/c
onfigure --with-gmp=/usr/local/gmp --with-mpfr=/usr/local/gmp --prefix=/irun
--e
nable-languages=c,fortran,c++
Thread model: single
gcc version 4.1.0 20051010 (experimental)
Kamaraju-san, are you in a position to update to the latest cvs or to
download one of the binaries pointed to by the Wiki?
Paul T
More information about the Fortran
mailing list