[Patch, Fortran] F2008: Null pointer/non-allocated as absent dummy

Tobias Burnus burnus@net-b.de
Sun Aug 15 15:35:00 GMT 2010


  And yet another rather trivial F2008 change... (hours later) ... well, 
maybe it is not as trivial as I thought, but here it is.

The rules for absent actual arguments to optional dummies was changed 
from Fortran 2003 (12.4.1.6 Restrictions on dummy arguments not present) 
to Fortran 2008 (12.5.2.12 Argument presence and restrictions on 
arguments not present) by adding the following:

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 mostly matches the current "present()" checks, except for 
descriptors (where the data element is NULL) and for directly passing 
EXPR_NULL. (At least I read it such that passing NULL() is allowed.) 
Thus, removing some checks - and changes for EXPR_NULL and assumed-shape 
arrays was all what was needed.

I also added a check that NULL() is not used for allocatable or 
non-optional dummies.

Build and regtested on x86-64-linux. OK for the trunk?

Tobias
-------------- next part --------------
A non-text attachment was scrubbed...
Name: null_actual.diff
Type: text/x-patch
Size: 6255 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20100815/14eac56f/attachment.bin>


More information about the Fortran mailing list