Minimal testcase to `use' some module cannot be compiled. Compilation works fine on Fedora gcc-gfortran-4.3.2-7.x86_64. GNU Fortran (GCC) version 4.4.0 20081124 (experimental) (x86_64-unknown-linux-gnu) compiled by GNU C version 4.4.0 20081124 (experimental), GMP version 4.2.2, MPFR version 2.3.2. GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096 $ gcc-build/gcc/f951 -o gccmod.s gccmod.f90 -Wall -ggdb2 initFatal Error: Reading module mmm at line 16 column 65: Expected left parenthesis $ cat gccmod.f90 module mmm contains subroutine init end subroutine init end module mmm program main use mmm end program main $ _ (In fact no `module mmm' part needs to be present there.)
Works for me. $ /usr/local/bin/gfortran -v Utilisation des specs internes. Target: x86_64-unknown-linux-gnu Configuré avec: ../src/configure --enable-languages=fortran --enable-maintainer-mode --disable-multilib : (reconfigured) ../src/configure --enable-maintainer-mode --disable-multilib --enable-languages=c,fortran --no-create --no-recursion : (reconfigured) ../src/configure --enable-maintainer-mode --disable-multilib --enable-languages=c,fortran --no-create --no-recursion Modèle de thread: posix gcc version 4.4.0 20081123 (experimental) (GCC)
The error message looks as if you are mixing a gfortran 4.3 compiled .mod file with a gfortran 4.4 compiler (or vice versa). While the gfortran 4.3 compiled *.o/*.so/*.a files are supposed to be compatible with 4.4's libgfortran.so, for .mod files this is not the case. (.mod files are not like *.h files compiler independent, but simply a "binary" dump of the interfaces of a single module.) I think a solution would be to create a version number for the .mod data and add a checking.
Created attachment 16759 [details] Check the file manipulations errors. Thanks Tobias B., unlink("mmm.mod") = -1 EPERM (Operation not permitted) rename("mmm.mod0", "mmm.mod") = -1 EPERM (Operation not permitted) write(2, " init"..., 5) = 5 stat("mmm.mod", {st_mode=S_IFREG|0644, st_size=547, ...}) = 0 open("mmm.mod", O_RDONLY) = 4 With the attached patch the same command now fails for me: Fatal Error: Can't delete module file 'mmm.mod': Operation not permitted I have no GCC SVN write permissions. Left one unchecked unlink() in an error recovery path there.
Subject: Bug 38248 Author: burnus Date: Tue Nov 25 12:51:44 2008 New Revision: 142190 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=142190 Log: 2008-11-25 Jan Kratochvil <jan.kratochvil@redhat.com> PR fortran/38248 * module.c (gfc_dump_module): Check rename/unlink syscalls errors. Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/module.c
Can we close ?
> Can we close? Think so. Closing.