Is the following code valid?

Tobias Burnus burnus@net-b.de
Fri Feb 9 16:08:00 GMT 2007


Hi Dominique,

Dominique Dhumieres wrote:
> MODULE debug
>   LOGICAL debug_area
>   NAMELIST/debugging/debug_area
> END MODULE debug
>
> PROGRAM ding
>   USE debug
>   IMPLICIT NONE
>   NAMELIST/debugging/debug_area
>   INTEGER :: ios
>   OPEN(unit=10, status='unknown', file='input.dat')
>   READ(unit=10, nml=debugging,  iostat=ios)
>   PRINT*, 'nml=debugging',ios
> END PROGRAM ding
>
> valid? Gfortran and Portland group Fortran accept it
> while xlf, ifort, and g95 reject it
>   
It is wrong and gfortran rejects it with -std=f95 and -std=f2003 (cf.
match.c):

foo.f90:10.21:
  NAMELIST/debugging/debug_area
                    1
Error: Namelist group name 'debugging' at (1) already is USE associated
and cannot be respecified.

I would argue that one should change GFC_STD_GNU into GFC_STD_LEGACY and
thus give an error by default.
Opinions?

Tobias



More information about the Fortran mailing list