------- Comment #7 from sgk at troutmask dot apl dot washington dot edu  
2006-10-22 15:00 -------
Subject: Re:  ICE in gfc_match_common for blank common in BLOCK DATA unit

On Sun, Oct 22, 2006 at 11:36:15AM -0000, aldot at gcc dot gnu dot org wrote:
> 
> ------- Comment #5 from aldot at gcc dot gnu dot org  2006-10-22 11:36 -------
> I think the code in comment #1 is valid.
> 
> f95, 5.5.2.4 Differences between named common and blank common
> reads:
> A blank common block has the same properties as a named common block except
> (iii) [...] objects in blank common shall not be initially defined.
> 
> 
> 11.8 defines BLOCK DATA as
> 
> block-data-stmt
>   [specification-part]
> end-block-data-stmt
> 
> where [specification-part] lists no further constrained (wrt blank common).
> blank-common imposed constraints seem to include
> - 5.1 Type decl stmts: [initialization] shall not appear if obj-name is [...]
> an object in blank common
> 

You're reading the wrong standard.  The final committe draft of
Fortran 95 states:

11.4    Block data program units
   A block data program unit is used to provide initial values for
   data objects in named common blocks.

I'll note that NAG's compiler only issues a warning.

laptop:kargl[212] cat l.f90
block data a
  common c
end block data a
laptop:kargl[213] f95 -c l.f90
Warning: l.f90, line 2: Blank common appears in BLOCK DATA A

If F2003 removes the "named" modifier from common blocks in 
its discussion on block data, then gfortran should probably
implement the F2003 behavior with the caveat that -std=f95
should issue a warning.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29537

Reply via email to