[Patch, Fortran] PR 36704/38290
Daniel Kraft
d@domob.eu
Mon Dec 1 13:35:00 GMT 2008
Hi Janus,
Janus Weil wrote:
> this patch fixes two PRs (at least partially):
>
> * PR 36704 - Procedure pointer as function result: This I was planning
> to implement in 4.5, but when having a look at it over the weekend, I
> found that certain cases (i.e. those using a RESULT statement, see
> proc_ptr_12.f90) are really easy to implement, so maybe this could
> still go into 4.4 (since it's more of a bugfix than a 'feature')? The
> harder cases (without RESULT statement) I will then take care of
> later.
>
> * PR 38290 - Procedure pointer assignment checking: This adds a few
> additional checks for procedure pointer assignments and fixes comment
> #2 from the PR, including an ICE, so it's even a 4.4 regression.
From my point of view, those should be both ok.
- if (gfc_add_flavor (&r->attr, FL_VARIABLE, r->name, NULL) == FAILURE
- || gfc_add_result (&r->attr, r->name, NULL) == FAILURE)
+ if (gfc_add_result (&r->attr, r->name, NULL) == FAILURE)
return MATCH_ERROR;
Adding flavour FL_VARIABLE goes here without replacement (of course, it
need to), but why was it needed in the first place? Could this harm
somehow?
- if (sym->attr.flavor == FL_UNKNOWN) sym->attr.flavor = FL_PROCEDURE;
Ditto. What happens if the flavour is FL_UNKNOWN and would have been
set to PROCEDURE? Why is this simply not needed?
Cheers,
Daniel
--
Done: Arc-Bar-Cav-Rog-Sam-Val-Wiz
To go: Hea-Kni-Mon-Pri-Ran-Tou
More information about the Fortran
mailing list