The following is illegal (only digits or a character constant can follow STOP): $> cat stop.f90 STOP "a" // "constant" END $> gfortran-svn stop.f90 && ./a.out STOP aconstant gcc version 4.4.0 20090324 (experimental) (GCC)
I think it is allowed in Fortran 2008 (could also be F2003 - I don't recall). Since that Fortran version also "STOP <integer-expression>" is allowed.
(In reply to comment #1) > I think it is allowed in Fortran 2008 (could also be F2003 - I don't recall). > Since that Fortran version also "STOP <integer-expression>" is allowed. > It is not allowed in F2003. 8.4 STOP statement R849 stop-stmt is STOP [ stop-code ] R850 stop-code is scalar-char-constant or digit [ digit [ digit [ digit [ digit ] ] ] ] The pdf I have marked as F2008 also contains the above text.
(In reply to comment #2) > It is not allowed in F2003. > > 8.4 STOP statement > R849 stop-stmt is STOP [ stop-code ] > R850 stop-code is scalar-char-constant > or digit [ digit [ digit [ digit [ digit ] ] ] ] I agree with you for F2003. For F2008, however, the draft I have (08-007r1:2008/02/19) says: R855 stop-stmt is STOP [ stop-code ] R857 stop-code is scalar-char-initialization-expr or scalar-int-initialization-expr
Now that PR 43851 has been fixed, can we close this PR as WONTFIX? [Checking the constraints for -std=f2003 is quite difficult - as it turned out - and Fortran 2008 allows any constant expression (= 'initialization expression' in F2003 lingo).]
yes, lets close