Greg Chicares <[EMAIL PROTECTED]> 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 7.20.5.2/4 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. -boris _______________________________________________ Help-make mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-make
