https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82215

Thomas Koenig <tkoenig at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2017-09-15
                 CC|                            |tkoenig at gcc dot gnu.org
     Ever confirmed|0                           |1
           Severity|normal                      |enhancement

--- Comment #3 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
I think this is the PR that comes as a PDF report :-)

I think it would actually be enough to have a flag
to suppress the output of the *.mod file.

You could then do

foo.mod: foo.f90
        gfortran -fsyntax-only foo.f90

foo.o: foo.mod foo.f90
        gfortran -fmodule-files=no foo.f90

This would first generate the module file, and then compile it.

The problem with this (which is like your suggestion in the footnote,
but I don't think it is necessary to store the source path in the module)
is the potential to generate inconsistent *.o and *.mod files if
the user is not careful.

We could just say "Use at your own risk" in the docs and give
an exaple of correct use. I am not sure this is a good
solution.

Or we could decide to read in the module files, check for
consistency, and abort if something inconsistent is found.
This would be a major rewrite.

And all of this to address a problem that, as far as I can
tell, is already addressed using F2008's submodules.

A better solution would be a utility  (or compiler flag)
that parses a *.mod file and outputs source code suitable
for calling the original module as a submodule.  This could ease
the transition a lot.  (A bit like the automatic output
of C interop prototypes, which I wrote recently).  It would
just be syntactic sugar around the Fortran tree dumper.

So, undecided on the best way to proceed, but confirming.

Reply via email to