This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: equivalence croakage
On Mon, Nov 02, 2009 at 05:39:23PM +0100, Dominique Dhumieres wrote:
> If I replace 'data j(2)/7/' with 'data j/1,1/' I get
>
> equiv_bad_1.f90:3.11:
>
> data i(1)/5/
> 1
> Error: Overlapping unequal initializers in EQUIVALENCE at (1)
>
> which may lead the user to what's wrong (a double locus would be
> more helpful). For the code in http://gcc.gnu.org/ml/fortran/2009-11/msg00011.html
> the error is very unfriendly:
>
> <During initialization>
>
> Error: Overlapping unequal initializers in EQUIVALENCE at (1)
>
> "<During initialization>" is generated when there is no known locus.
> I find also "unequal" misleading: once you know what the problem is,
> it is "unequal values for the same memory location(s)", but if
> you don't know what's going wrong, you can think that it is the length
> of the data, ... .
>
Yep. This is related to the old-style g77 non-standard
initialization. If the OP had used -Wall, he would have
had the opportunity to fix his poorly conformng code.
--
Steve