Documentation patch for DELIM= related to namelist

Steve Kargl sgk@troutmask.apl.washington.edu
Fri Mar 21 17:27:00 GMT 2014


On Fri, Mar 21, 2014 at 09:11:05AM -0700, Jerry DeLisle wrote:
> Here is some wording I am proposing to add to docs about extensions.  OK?
> 
> Jerry
> 
> Index: gfortran.texi
> ===================================================================
> --- gfortran.texi	(revision 208303)
> +++ gfortran.texi	(working copy)
> @@ -1487,6 +1487,11 @@
>  /
>  @end smallexample
> 
> +When writing a namelist, if no DELIM= is specified, a double quote is
> +used to delimit character strings.  This is done to ensure that
> +namelists with character strings can be subsequently read back in
> +accurately.
> +

Doesn't this violate the standard?  In F2008, 9.5.6.8, one finds:

    If this specifier is omitted in an OPEN statement that initiates
    a connection, the default value is NONE.

"NOTE 10.40" is a cautionary note about this specific issue.

    NOTE 10.40
    Namelist output records produced with a DELIM= specifier with a
    value of NONE and which contain a character sequence might not be
    acceptable as namelist input records.

This program

  character(len=10) s
  namelist /today/ s
  s = 'a b c d e'
  open(unit=10,file='tmp.dat')
  write(10, nml=today)
  close(10)
  end

yields

&TODAY
 S="a b c d e ",
 /

even if I compile with -std=f95, -std=f2003, or -std=f2008.  I suppose
I should have looked more closely at your patch, because an extension
that violates the standard when one specifically request conformance
needs to be turned off.

-- 
steve



More information about the Fortran mailing list