This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libfortran/33079] New: Optional empty strings do not appear to be 'PRESENT'
- From: "P dot Schaffnit at access dot rwth-aachen dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Aug 2007 13:01:50 -0000
- Subject: [Bug libfortran/33079] New: Optional empty strings do not appear to be 'PRESENT'
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Hi!
See
http://gcc.gnu.org/ml/fortran/2007-08/msg00336.html
and
http://gcc.gnu.org/ml/fortran/2007-08/msg00338.html
GFortran seems to handle in a slightly surprising way optional empty strings...
Cheers!
Philippe
PS: a testcase from François-Xavier Coudert
CHARACTER(LEN=1) :: s
s = " "
CALL bar (s)
CALL bar (trim(s))
CONTAINS
SUBROUTINE bar (s)
CHARACTER(LEN=*), OPTIONAL :: s
IF (PRESENT (s)) THEN
WRITE(*,"(A)") "Argument: |" // s // "|"
ELSE
WRITE(*,"(A)") "No argument"
END IF
END SUBROUTINE bar
END
--
Summary: Optional empty strings do not appear to be 'PRESENT'
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libfortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: P dot Schaffnit at access dot rwth-aachen dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33079