[Patch, Fortran] Cleanup of gfc_extend_expr

Janus Weil janus@gcc.gnu.org
Thu Nov 3 21:59:00 GMT 2011


> 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gfc_extend_expr_v2.diff
Type: text/x-diff
Size: 3058 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20111103/c59c2261/attachment.bin>


More information about the Fortran mailing list