Proposed patch to 13249

Paul Brook paul@codesourcery.com
Sun May 16 21:33:00 GMT 2004


> > 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



More information about the Fortran mailing list