This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Proposed patch to 13249


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]