This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch] opcodes/z8k-opc.h regenerated


Alan Modra <amodra@bigpond.net.au> writes:

> The idea of using the address is to leave elements with the same key
> in the order they occur in the original array.  That works with qsort
> that sorts in place, ie. doesn't copy parts of the input array to
> temporary storage.

The standard forbids that anyway.  But it does not forbid shuffling in a
way that the relative order of two elements changes even if that would
make them order backwards temporarily.  If you want a stable sort you
need to decide on the contents alone, not on the address.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]