Re: test-mergesort conflict with stdlib.h

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: test-mergesort conflict with stdlib.h

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:53:37

Brian Gernhardt [off-list ref] writes:
On OS X 10.7.3, I get the following error attempting to build next:

    CC test-mergesort.o
In file included from test-mergesort.c:2:
./mergesort.h:4:7: error: conflicting types for 'mergesort'
void *mergesort(void *list,
      ^
/usr/include/stdlib.h:306:6: note: previous declaration is here
int      mergesort(void *, size_t, size_t,
         ^

This appears to be due to the fact that 0db71e0: "add mergesort() for
linked lists" added a mergesort implementation with a different
signature than a mergesort implemented by OS X's standard library.
Unfortunate.  OS X shouldn't contaminate the user namespace by adding such
names in stdlib.h (which incidentally has qsort()), but the damage is done
already, so I am not opposed to rename it to llist_mergesort() or something.

Re: test-mergesort conflict with stdlib.h

From: Brian Gernhardt <hidden>
Date: 2016-06-15 22:53:37

On Apr 17, 2012, at 1:46 PM, Junio C Hamano wrote:
Unfortunate.  OS X shouldn't contaminate the user namespace by adding such
names in stdlib.h (which incidentally has qsort()), but the damage is done
already, so I am not opposed to rename it to llist_mergesort() or something.
This seems to be inherited from BSD's userspace which also has a mergesort (radixsort as well).  I'll make a patch to rename it and if anyone doesn't like llist_mergesort, they can repaint the bikeshed themselves.

~~ Brian Gernhardt
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help