[mpich-discuss] mpich2-1.0.7 file mpif.h and fortran compiler g95

Steve Kargl sgk at troutmask.apl.washington.edu
Sat Oct 11 17:26:40 CDT 2008


On Sat, Oct 11, 2008 at 02:13:10PM -0700, Martin Siegert wrote:
> Surely this is not a mpich problem but a problem with the program
> that includes the blanket save statement. The Fortran standard is
> quite clear about this:
> 
> "If a SAVE statement with an omitted saved entity list occurs in a scoping
> unit, no other explicit occurrence of the SAVE attribute or SAVE statement
> is permitted in the same scoping unit."
> 
> Thus, this is not a problem related to g95 since it follows the standard
> (you could argue that the gfortran behaviour is actually incorrect).

I forgot to point out that the -std=f95 will turn several warnings
into errors.  If you want an even strciter interpretation of the
standard, then use '-std=f95 -pedantic'

REMOVE:kargl[203] gfc -c a.f
a.f:4.10:

      save i                                                            
         1
Warning: SAVE statement at (1) follows blanket SAVE statement
a.f:3.15:

      integer i,j                                                       
              1
Warning: Duplicate SAVE attribute specified at (1)
REMOVE:kargl[204] gfc -c -std=f95 a.f
a.f:4.10:

      save i                                                            
         1
Error: SAVE statement at (1) follows blanket SAVE statement

-- 
Steve




More information about the mpich-discuss mailing list