Re: [bug-gnulib] Re: comparison_fn_t

2005-05-29 Thread Paul Eggert
[EMAIL PROTECTED] (Larry Jones) writes: > Paul Eggert writes: >> >> I should warn you that the C Standard does not allow that sort of >> cast. This is for portability to hosts that use different >> representations for different kinds of pointers; such hosts can use >> different calling conventio

Re: [bug-gnulib] Re: comparison_fn_t

2005-05-28 Thread Larry Jones
Paul Eggert writes: > > I should warn you that the C Standard does not allow that sort of > cast. This is for portability to hosts that use different > representations for different kinds of pointers; such hosts can use > different calling conventions for char * and void *, so casting the > funct

Re: [bug-gnulib] Re: comparison_fn_t

2005-05-27 Thread Paul Eggert
"Oskar Liljeblad" <[EMAIL PROTECTED]> writes: > Sure, but assume you're passing strcmp for the comparison function, > wouldn't you want to cast it to avoid the warning? I should warn you that the C Standard does not allow that sort of cast. This is for portability to hosts that use different rep

[bug-gnulib] Re: comparison_fn_t

2005-05-27 Thread Bruno Haible
Oskar Liljeblad wrote: > > extern void my_sort (void *, size_t, size_t, > >int (*) (const void *, const void *)); > > Sure, but assume you're passing strcmp for the comparison function, > wouldn't you want to cast it to avoid the warning? Yes, and there's nothing wrong wi

[bug-gnulib] Re: comparison_fn_t

2005-05-27 Thread Oskar Liljeblad
On Friday, May 27, 2005 at 13:26, Bruno Haible wrote: > > GNU libc defines comparison_fn_t in stdlib.h if _GNU_SOURCE is defined. > > The type is defined like this: > > > > typedef int (*comparison_fn_t) (const void *, const void *); > > > > I tend to use this type a little everywhere, so I would

[bug-gnulib] Re: comparison_fn_t

2005-05-27 Thread Bruno Haible
Oskar Liljeblad wrote: > GNU libc defines comparison_fn_t in stdlib.h if _GNU_SOURCE is defined. > The type is defined like this: > > typedef int (*comparison_fn_t) (const void *, const void *); > > I tend to use this type a little everywhere, so I would like to make > a module for this definitio