[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: pattern rules and pattern-specific-variables problem

From: Boris Kolpackov
Subject: Re: pattern rules and pattern-specific-variables problem
Date: Wed, 24 Aug 2005 19:37:53 +0000 (UTC)
User-agent: nn/6.6.5+RFC1522

Greg Chicares <address@hidden> writes:

> In a case like
>     fo%bar : FOO = bar
>     foo%ar : BAR = baz
>     fooZbar : @echo ;FOO = $(FOO)  /  BAR = $(BAR)
> wouldn't 'determine best match by sorting on length' be indeterminate
> here unless a stable sort algorithm is used?

Well, in this particular case it doesn't matter. In the following example
it does, however

fo%bar : FOO = bar
foo%ar : FOO = baz

> For instance, if qsort() is used, C99 says
>   If two elements compare as equal, their order in the
>   resulting sorted array is unspecified.
> Would a convention like 'resolve ties in favor of first occurrence'
> or 'sort first by longest matching initial substring' be best here,
> or would it be better to halt with a diagnostic message saying that
> two rules are equally applicable?

I think in case of a tie we should use the old rule, i.e., the
definition order.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]