Error: Syntax error in EQUIVALENCE statement at (1)

Steve Kargl sgk@troutmask.apl.washington.edu
Tue Jan 29 17:59:00 GMT 2019


On Tue, Jan 29, 2019 at 10:41:18AM -0700, Andrew F. Nelson via fortran wrote:
> 
> Hopefully this is the right email list (though it looks mostly like compiler
> dev traffic). If not please redirectly me appropriately.

Yes, the list is mostly for Fortran dev discussion.  However, 
we do encourage people who have problems with gfortran to
send emails.  If it's a general Fortran programming question,
you'll get redirected to comp.lang.fortran or stack overflow.

> I get the error in the subject above, when I compile a code I am currently
> developing for under gfortran 6.4.0 and 7.3.0. Unfortunately, I can't provide
> source for that code and don't have a quick/easy reproducer as
> an example. What I'm hoping you can help me with is some advice about what
> the error is and what to do about it, because, as you will note from the
> following description, it isn't obvious what is wrong.

Without seeing the code, we can only speculate.

> 
> It triggers in the use statement inside a subroutine, contained
> in a module, and points to a Use statement in that subroutine.
> The use statement includes a number of variables and arrays from
> another module as follows:
> 
> Use The_module, only : <variables>
>     1
> Error: Syntax error in EQUIVALENCE statement at (1)

The '1' pointer probably has the wrong position.  It is
likely trying to point to one of the variables.

> There are examples of the variables in the use statement that
> have equivalences, but if I remove those equivalences and the
> equivalenced variables entirely, the error still triggers. So
> I conclude the error has nothing to do with an actual
> equivalence.

This sounds like a dependency issue during recompilation.  Did
you remove all old *.mod files that depend on the module which
had the EQUIVALENCE statements?

-- 
Steve



More information about the Fortran mailing list