------- Comment #1 from burnus at gcc dot gnu dot org  2006-12-08 08:23 -------
Created an attachment (id=12770)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=12770&action=view)
Test program

With the program below I get with NAG f95, sunf95 and ifort:

Inquire by UNIT

 Non-existing, closed file:
   FORMATTED = UNKNOWN
 UNFORMATTED = UNKNOWN
        FORM = UNDEFINED
 Existing, closed file:
   FORMATTED = UNKNOWN
 UNFORMATTED = UNKNOWN
        FORM = UNDEFINED
 Existing, opened file:
   FORMATTED = NO
 UNFORMATTED = YES
        FORM = UNFORMATTED

Inquire by FILE NAME

 Non-existing, closed file:
   FORMATTED = UNKNOWN
 UNFORMATTED = UNKNOWN
        FORM = UNDEFINED
 Existing, closed file:
   FORMATTED = UNKNOWN
 UNFORMATTED = UNKNOWN
        FORM = UNDEFINED
 Existing, opened file:
   FORMATTED = NO
 UNFORMATTED = YES
        FORM = UNFORMATTED


Whereas gfortran (and g95) give:

Inquire by UNIT

 Non-existing, closed file:
   FORMATTED = UNKNOWN
 UNFORMATTED = UNKNOWN
        FORM = UNDEFINED
 Existing, closed file:
   FORMATTED = UNKNOWN
 UNFORMATTED = UNKNOWN
        FORM = UNDEFINED
 Existing, opened file:
   FORMATTED = YES
 UNFORMATTED = YES
        FORM = UNFORMATTED

Inquire by FILE NAME

 Non-existing, closed file:
   FORMATTED = UNKNOWN
 UNFORMATTED = UNKNOWN
        FORM = UNDEFINED
 Existing, closed file:
   FORMATTED = YES
 UNFORMATTED = YES
        FORM = UNDEFINED
 Existing, opened file:
   FORMATTED = YES
 UNFORMATTED = YES
        FORM = UNFORMATTED


The standard says:

"The scalar-default-char-variable in the FORMATTED= specifier is assigned the
value YES if FORMATTED is included in the set of allowed forms for the file, NO
if FORMATTED is not included in the set of allowed forms for the file, and
UNKNOWN if the processor is unable to determine whether or not FORMATTED is
included in the set of allowed forms for the file."

I have actually some problems to interpret this properly (cf. also PR 29578).


-- 


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

Reply via email to