[PATCH,fortran]: proposed fix for PR 33020

FX Coudert fxcoudert@gmail.com
Thu Aug 9 23:04:00 GMT 2007


:REVIEWMAIL:

> the attached patch fixes PR 33020.  currently, the kind of the  
> SHAPE parameter to c_f_pointer is set once the actual is seen.   
> however, this can prevent shape arguments of different kinds being  
> used for different calls within the same namespace.  the SHAPE  
> parameter should not be set because it needs to allow any valid  
> integer kind.

Then why also remove the type, as follows?

> -  /* Give the optional SHAPE formal arg a type now that we've done  
> our
> -     initial checking against the actual.  */
> -  if (sym->intmod_sym_id == ISOCBINDING_F_POINTER)
> -    sym->formal->next->next->sym->ts.type = BT_INTEGER;

  I can understand that it needs to not have a kind, but it has to be  
an integer, right? With your patch, do you still correctly diagnose  
if someone tries to use a REAL array as shape?

If you answer to that question, it's OK to commit.

FX



More information about the Fortran mailing list