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



--- Comment #4 from Tobias Burnus <burnus at gcc dot gnu.org> 2013-03-30 
10:47:30 UTC ---

Created attachment 29752

  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29752

Test case  - please read comment in the file or comment 4



The test case is successful with ifort 13.1, it fails (iostat/=0, run time

failure) with Crayftn and PGI already for "i=1!".





According to the Fortran standard, the example - as the example in comment 0 -

is invalid. From Fortran 2008, "10.11.3.6 Namelist comments":



"Except within a character literal constant, a "!" character after a value

separator or in the first nonblank position of a namelist input record

initiates a comment."



Note the "after a value separator". In "i=1!" there is no value separator after

the value "1".





For my character example "c1 = a": Also that example is invalid according to

the Fortran standard, which states in "10.11.3.3 Namelist input values":



"When the next effective item is of type character, the input form consists of

a delimited sequence of zero or more rep-chars [...]"



Thus, either " or ' is required as delimiter - but the example doesn't use

neither.







EXPECTED RESULTS:



(a) "i=1!" is either accepted as vendor extension as "i=1 !...", matching

Intel's result.  Or it is rejected with a compile-time error as Crayftn and PGI

do it.



Currently, integers and reals (except for INF/NAN) give not error but the

result is not modified (BUG!).  For logical, complex and delimited character

strings, the value is read (as vendor extension), and for INF and NAN a "cannot

match namelist object" error is shown - which is acceptable according to the

standard an matches PGI/Crayftn.





(b) For nondelimited character strings: Currently, it gives the error "Cannot

match namelist object", which is fine according to the standard. One could

still consider to support reading it as vendor extension - as Intel does.

(Simply read from the first nonspace character to the first value separator.)

Reply via email to