[comp.lang.fortran] Adjacent apostrophe edit descriptors

pmontgom@oak.math.ucla.edu (01/05/90)

        program test 
        print 10
10      format (' Does an apostrophe appear here'  ' or here', '.')

C               There is no comma separating the first two 
C       apostrophe edit descriptors in this format statement.  
C       The SUN 3 and SPARC compilers accept it anyhow, 
C       and print the output without any apostrophes.  
C       The Alliant compiler (V4.2.40) also accepts it, 
C       but produces an apostrophe after the first "here".
C       Neither compiler produces one after the second "here".

C               Lines 26-34 on p. 13-2 of ANSI X3.9-1978 FORTRAN 77
C       say the comma may be omitted before and after a slash
C       or colon edit descriptor, but do not allow it to be
C       omitted in this instance.  Lines 30-32 on p. 13-5 say
C       "Within the (apostrophe edit) field, two consecutive 
C       apostrophes with no intervening blanks are counted as a
C       single apostrophe", but says nothing about intervening
C       blanks (as here).  

C               The statement seems nonstandard (unless it means
C       to output everything between the first apostrophe and the
C       last, including both intervening apostrophes and the blanks).
C       However, when I try the -ansi option on the SPARC, or
C       the -standard option on the Alliant, the only diagnostic
C       either compiler gives is the presence of lowercase letters. 

        end
--------
        Peter Montgomery
        pmontgom@MATH.UCLA.EDU 
	Department of Mathematics, UCLA, Los Angeles, CA 90024

jlg@lambda.UUCP (Jim Giles) (01/06/90)

From article <2127@sunset.MATH.UCLA.EDU>, by pmontgom@oak.math.ucla.edu:
> 
>         program test 
>         print 10
> 10      format (' Does an apostrophe appear here'  ' or here', '.')

This is non-standard, but is quite common practice anyway.  The reason
is that the standard permits commas to be omitted between some edit
specifiers and not others (as you pointed out).  It is simpler to
implement a parser for FORMAT specifications if the comma is optional
everywhere.  A compiler which does this may still be a standard conforming
one as long as it accepts all standard FORMAT specifications correctly.
A program which uses this extended feature is not standard conforming,
but the compiler is under no obligation to report this.

lsanvill@hpcllmv.HP.COM (Liz T. Sanville) (01/06/90)

>/ hpcllmv:comp.lang.fortran / pmontgom@oak.math.ucla.edu /  8:12 pm  Jan  4, 1990 /
>
>        program test 
>        print 10
>10      format (' Does an apostrophe appear here'  ' or here', '.')
>        end
>--------
>        Peter Montgomery
>        pmontgom@MATH.UCLA.EDU 
>	Department of Mathematics, UCLA, Los Angeles, CA 90024
>----------

A problem identical to this was filed against Fortran as  SR5000-485490.
This is a bug in the s800 Fortran compiler.  The fix should be available
in the next release of the compiler.

Thanks for reporting the problem.  More details are available in the SR.

Liz Sanville.

lmp@stc06.ornl.gov (PETRIE L M) (01/08/90)

------------------------

	Data for additional compilers on mainframes

IBM VS Fortran flags the blank separated apostrophes as non ansi
standard useage and assumes a comma between them.

Cray CFT77 Fortran flags the blank separated apostrophes as non
ansi standard and assumes a comma between them.

			Lester Petrie