This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/44666] New: [F2008] Passing NULL pointer or unallocated allocatable to OPTIONAL dummy
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Jun 2010 14:36:51 -0000
- Subject: [Bug fortran/44666] New: [F2008] Passing NULL pointer or unallocated allocatable to OPTIONAL dummy
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
"12.5.2.12 Argument presence and restrictions on arguments not present
A dummy argument or an entity that is host associated with a dummy argument is
not present if the dummy argument
[...]
* does not have the ALLOCATABLE or POINTER attribute, and corresponds to an
actual argument that
- has the ALLOCATABLE attribute and is not allocated, or
- has the POINTER attribute and is disassociated."
That probably means:
a) NULL(mold) as actual argument is allowed
b) For scalars, it should just work
c) For arguments with descriptors, one needs to add:
(actual.data == NULL) ? NULL : actual
--
Summary: [F2008] Passing NULL pointer or unallocated allocatable
to OPTIONAL dummy
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: burnus at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44666