[C PATCH] field_decl_cmp

Nathan Sidwell nathan@acm.org
Fri Sep 15 17:43:00 GMT 2017


On 09/12/2017 12:48 PM, Joseph Myers wrote:

> I'd be concerned about the possibility of a qsort implementation that
> calls the comparison function with two pointers to the same object (as far
> as I can tell, it's valid for qsort to do that).  That is, I think you
> need to check for the two DECLs being the same DECL, before asserting
> their names are different.

I suppose we can drop the assert.  That does leave it returning +1 in 
the case you're concerned about, but I don't really see the need to tell 
such a stupid qsort that the things are unordered.

nathan

-- 
Nathan Sidwell
-------------- next part --------------
A non-text attachment was scrubbed...
Name: field-cmp.diff
Type: text/x-patch
Size: 1014 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20170915/fd3e72eb/attachment.bin>


More information about the Gcc-patches mailing list