spahlinger -> RE: Segmentation fault (core dumped) (Sep. 19, '06, 4:31:25 AM) |
Your FORTRAN program calls FALLOC with a list of constant parameters: CALL FALLOC(1,1,1,1,1,1). These parameters are given to the c program by refeference, which in turn tries to change these arguments. But this is not allowed, because these are constants. If you change your FORTRAN code to
program constvar
i=6
j=1
k=1
l=1
m=1
n=1
CALL FALLOC(i,j,k,l,m,n)
print*,"Hello " ,i,j,k,l,m,n
end
you will see what happens. The result would be:
Hello 6 1 1 29 21319 8604752
As can be seen, the last three parameters have been modified, meaning that it is invalid to use contants here.
By the way, I think that it is also invalid to use calloc or printf in the c program, because when linking with g77 (instead of gcc) the gcc-specific initialization routines for heap menagement and io-handling are not performed. |
|
|
|