This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: Proposed patch to 13249
- From: Paul Brook <paul at codesourcery dot com>
- To: fortran at gcc dot gnu dot org
- Cc: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>,Victor Leikehman <lei at haifasphere dot co dot il>, dann at godzilla dot ics dot uci dot edu
- Date: Sun, 16 May 2004 22:33:07 +0100
- Subject: Re: Proposed patch to 13249
- Organization: CodeSourcery
- References: <40A7784C.1050502@haifasphere.co.il> <20040516171229.GA84723@troutmask.apl.washington.edu>
> > gfc_add_common (symbol_attribute * attr, locus * where)
> > {
> > if (check_used (attr, where) || check_done (attr, where))
> > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > return FAILURE;
>
> I think the check is there for this modified program
>
> MODULE MOD
> INTEGER FOO
> END
> PROGRAM MAIN
> USE MOD
> COMMON /BAR/ FOO
> END
>
> kargl[223] gfc -o r r.f90
> In file r.f90:6
>
> COMMON /BAR/ FOO
> 1
> Error: Cannot change attributes of USE-associated symbol at (1)
>
> I suspect the if (...) needs to check that the FOO in your
> "COMMON /FOO/ BAR" is not the name of a COMMON block.
Nope, this error is issued elsewhere (commenting out that check still rejects
the above code).
However the proposed patch is just glossing over deeper problems.
We shouldn't be adding a symbol for the common block name in the first place.
Or if we do create symbols for common blocks their namespace shouldn't
overlap with normal symbols.
Paul