[Top][All Lists]

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

Re: $(sort) - what is "lexical order"? (was RE: Follow-up)

From: Edward Welbourne
Subject: Re: $(sort) - what is "lexical order"? (was RE: Follow-up)
Date: Tue, 19 Jul 2011 21:29:11 +0200

> GNU make uses the standard C runtime function qsort(3) to perform its
> sorting, with a comparison function of the standard C runtime function
> strcmp().
> The builtin sort function DOES sort.  It may not sort the way you would
> prefer, but it sorts in a standard, repeatable, well-defined way that
> does not change based on a particular user's environment settings...
> most creators of build systems consider this reproducibility to be MUCH
> more important than locale-specific collation, which is just visual
> flourish.

So the short story is: we *could* use strcoll() and have make adapt
itself to the locale preferences of users, but doing that would
probably lead to subtle ways that make files would work for their
authors and be broken for other users, which would be seriously
difficult to debug.  We would then need a way for make to let authors
specify, in a make-file, that it should use some particular locale
instead of whatever happens to please the user (so as to avoid such
bugs).  Every responsible make-file author would then exercise this
and chose POSIX, i.e. C, so we'd be back where we are today.  Ergo,
it's really not worth making such a change.


reply via email to

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