[Patch, Fortran] Cleanup of gfc_extend_expr
Steve Kargl
sgk@troutmask.apl.washington.edu
Thu Nov 3 00:27:00 GMT 2011
On Thu, Nov 03, 2011 at 12:06:23AM +0100, Janus Weil wrote:
> 2011/11/2 Steven Bosscher <stevenb.gcc@gmail.com>:
> > On Wed, Nov 2, 2011 at 11:17 PM, Janus Weil <janus@gcc.gnu.org> wrote:
> >> What the patch does is to change the return value from
> >> 'gfc_try' (SUCCESS/FAILURE) to 'match'
> >> (MATCH_YES/MATCH_NO/MATCH_ERROR). Of course we're not really
> >> 'matching' anything here, but the yes/no/error range of values is
> >> exactly what we need in this case, so I think (ab-)using the 'match'
> >> enum makes sense.
> >
> > I don't like that at all. Sooner or later that's going to confuse
> > someone.
>
> I found the current way even more confusing and thought this might be better.
>
>
> > There has to be a better solution...
>
> ... like what? Introducing a new enum just for this one case? Probably not.
>
> Anyway, we can also just leave it like it is. It was just a small
> thing that I stumbled across.
>
At least add a comment about the re-use (abuse?) of the
enum. This should reduce confusion months from when
someone wonders why gfc_extend_expr returns a "match"
for a non-matching function.
--
Steve
More information about the Gcc-patches
mailing list