Question

We have a big software package written time ago in Fortran 77 using a Compaq compiler that assumed a SAVE in every subroutine, so no subroutine has a explicit SAVE in the code.

Now I had to reuse and modify it to make it work in Linux with gfortran. Gfortran is in fact a f90 compiler but it worked with just some minimum changes and some additional flags. However I'm having problems with the missing SAVE statements. Some COMMON structures are not SAVEd, some are, and it seems to depend on the platform (Windows/Linux) and gfortran version.

I've tried the flag -fno-automatic, but some COMMON blocks are still unsaved, as the man page says, the -fno-automatic doesn't affect the COMMON blocks.

Any idea how can I force a SAVE in every subroutine using gfortran? I'd like to avoid modifying every subroutine.

Thank you.

Était-ce utile?

La solution

You may have to use -fno-automatic compiler option and a save statement with the names of all the named common blocks. See "Saving" a common block

Autres conseils

try the compiling option -fno-automatic

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top