This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: Patch to gfortran PR13742


On Wednesday 05 May 2004 13:49, Tobias Schlüter wrote:
> Victor Leikehman wrote:
> > +      if (is_init)
> > +     gfc_error ("Variables in COMMON block should not"
> > +              " have initializers"); /* common_bad.f90 */
> > +      decl = build_common_decl (sym, union_type, is_init);
>
> I don't believe this is correct. I didn't find a place where this is
> explicitly allowed in the standard, but on line 22, page 49 of the
> (draft) Fortran 95 standard (this is section 5.1 right before 5.1.1) it
> says:
> ----
> The presence of /initialization/ implies that /object-name/ is saved,
> except for an /object-name/ in a named common block or an /object-name/
> with the PARAMETER attribute.
> ----

From section 5.5.2.4 "Differences between named common and blank common"

"(3) A data object in a named common block may be initially defined by means 
of a DATA statement [...] objects in a blank common may not be initially 
defined."

Paul


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