[Patch, Fortran] Variable definition context checks

Tobias Burnus burnus@net-b.de
Wed Sep 22 20:55:00 GMT 2010


  Daniel Kraft wrote:
> the attached patch implements general checks for things, that may/may 
> not appear in a "variable definition context" or "pointer association 
> context". [...]
>
> Note that this patch does not yet check the full list of variable 
> definition contexts as given in the standard (F2008, 16.6.7), missing 
> are the LOCK/UNLOCK items as well as the stuff related to IO -- this 
> was the minimal set required to make the test-suite pass.  [...]  I 
> would like to get this in now [...] and add the remaining contexts as 
> a follow-up.

I am fine with adding the rest add follow up; however, I assume you 
would like to defer the implementation of LOCK/UNLOCK (related to 
coarrays) even further ;-)

> No regressions on GNU/Linux-x86-32.  Ok for trunk?

The patch is OK - with the nits fixed.

+	    gfc_error ("Dummy-argument '%s' with INTENT(IN) in pointer"
+	    gfc_error ("Dummy-argument '%s' with INTENT(IN) in variable"

Any reason for using a hyphen? I would simply use "Dummy argument".


+	    gfc_error ("Associate-name '%s' can not appear in a variable"
+		       " definition context (%s) at %L because it's target"
+		       " at %L can not, either",


I do not like the wording - but I have no better idea. Maybe someone 
else has. At least one should change "it's" to "its".

  * * *

I have to admit I do not like remove_last_array_ref - it feels like a 
hack -, but I fear that handling it in gfc_expr_attr unconditionally 
will break at many places. However, given that gfc_expr_attr is only 
used at 13 places and gfc_variable_attr at 5, wouldn't it make more 
sense to add a Boolean flag? OK with or without that change.

Tobias



More information about the Fortran mailing list