[Patch, Fortran] PR32616 - Add more actu./form. argument checks

Jerry DeLisle jvdelisle@verizon.net
Sat Jan 19 15:10:00 GMT 2008


Tobias Burnus wrote:
> This fix a typo and adds a bunch of argument checks:
> 
> a) The string length needs to match exactly not only if the dummy
> argument is a pointer or allocatable, but also if the dummy is an
> assumed-shape array:
> 
> "The type parameter values of the actual argument shall agree with the
> corresponding ones of the dummy argument that are not assumed or
> deferred, except for the case of the character length parameter of an
> actual argument of type default character associated with a dummy
> argument that is not assumed shape." (12.4.1.2)
> 
> 
> b) If one specifies an array element, a warning is now printed if the
> storage size of the array (starting from the array index and the lower
> bound of the substring) is smaller than the requested storage size of
> the dummy argument.
> There were already some tests before, but now also array elements are
> checked.
> 
> 
> c) Regarding the typo: It is indeed INTENT(OUT); the check above is:
>       if ((f->sym->attr.intent == INTENT_OUT
>            || f->sym->attr.intent == INTENT_INOUT
>            || f->sym->attr.volatile_)
> and the standard mandates: "If the actual argument is an array section
> having a vector subscript, the dummy argument is not definable and shall
> not have the INTENT(OUT), INTENT(INOUT), VOLATILE, or ASYNCHRONOUS
> attributes." (12.4.1.2)
> 
> 
> (Note: (b) only prints a warning; thus we will never reject a valid
> program if I missed something [I'm quite confident that I didn' ;-)].)
> 
> Build and regression tested on x86-64-linux.
> OK for the trunk?
> 
> Tobias
> 
Another I reviewed when it first came out and I failed to reply.

OK.

Jerry



More information about the Fortran mailing list