[Patch, Fortran] Cleanup of gfc_extend_expr
William Clodius
wclodius@los-alamos.net
Sat Nov 5 16:04:00 GMT 2011
Sounds like what everything needs is a differently named enum: say three_way_logic.
On Nov 3, 2011, at 3:56 PM, Janus Weil wrote:
>> At least add a comment about the re-use (abuse?) of the
>> enum.
>
> Updated patch attached, which adds a short comment on the usage of 'match'.
>
>
>> This should reduce confusion months from when
>> someone wonders why gfc_extend_expr returns a "match"
>> for a non-matching function.
>
> Well, I think my approach is not as far-fetched as you seem to imply:
> There are already a good number of procedures which use the 'match'
> enum, although they're not related to matching at all. Listing only
> those that occur in gfortran.h (I'm sure there are more):
>
> * match gfc_mod_pointee_as (gfc_array_spec *);
> * match gfc_intrinsic_func_interface (gfc_expr *, int);
> * match gfc_intrinsic_sub_interface (gfc_code *, int);
> * match gfc_iso_c_sub_interface(gfc_code *, gfc_symbol *);
>
> The reason for this is of course that the YES/NO/ERROR triple is not
> only useful in matching, but also in many other situations.
>
> Cheers,
> Janus
> <gfc_extend_expr_v2.diff>
More information about the Fortran
mailing list