[Bug fortran/78331] New: Misleading error message from submodule when module has no module procedures.
pault at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sat Nov 12 08:11:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78331
Bug ID: 78331
Summary: Misleading error message from submodule when module
has no module procedures.
Product: gcc
Version: 7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: pault at gcc dot gnu.org
Target Milestone: ---
As noted in
https://groups.google.com/forum/#!topic/comp.lang.fortran/NFCF9brKksg
MODULE MainModule
END MODULE MainModule
SUBMODULE (MainModule) MySub1
IMPLICIT NONE
INTEGER, PARAMETER :: a = 17
END SUBMODULE MySub1
PROGRAM MyProg
USE MainModule
WRITE(*,*) a
END PROGRAM MyProg
produces the error message.
module.f90:5:24:
SUBMODULE (MainModule) MySub1
1
Fatal Error: Can't open module file ‘mainmodule.smod’ for reading at (1): No
such file or directory
compilation terminated.
This comes about because the submodule is expecting to find and .smod file,
which is only generated when there are module procedures in the parent module.
A bit of logic juggling in module.c should suppress the error.
Paul
More information about the Gcc-bugs
mailing list