This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/78331] New: Misleading error message from submodule when module has no module procedures.


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]