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

--- Comment #13 from Steve Kargl <sgk at troutmask dot apl.washington.edu> ---
On Thu, Mar 22, 2018 at 12:44:25AM +0000, w.clodius at icloud dot com wrote:
> --- Comment #12 from William Clodius <w.clodius at icloud dot com> ---
> FWIW I was told on comp.lang.fortran that the code is erroneous because of
> 
> "The error message doesn't make much sense to me, but I think Note 12.2 
> in section 12.4.3.1 contains a clue to what's going on. It states: "
> 
> "An interface body cannot be used to describe the interface of an 
> internal procedure, a module procedure that is not a separate module 
> procedure, or an intrinsic procedure because the interfaces of such 
> procedures are already explicit.” 

gfortran was not checking

  /* C1246 (R1225) MODULE shall appear only in the function-stmt or
     subroutine-stmt of a module subprogram or of a nonabstract interface
     body that is declared in the scoping unit of a module or submodule.  */

so you had invalid code reaching other parts of the compiler.  It
still reaches that part because gfortran tries it's best to make sense
of possibly invalid code and continues to run a sequence of matchers.  It
queues up error messages.  It then spews them to the terminal.  Invalid
code may lead to an appropriate error message and a number of run-on
nonsense error messages.  It may also lead to an erronous error message
because it was queued by a previous matcher and not cleared.

Reply via email to