bug-gnulib
[Top][All Lists]
Advanced

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

[bug-gnulib] Re: comparison_fn_t


From: Oskar Liljeblad
Subject: [bug-gnulib] Re: comparison_fn_t
Date: Fri, 27 May 2005 14:33:06 +0200
User-agent: Mutt/1.5.9i

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 like to make
> > a module for this definition.
> 
> You can do that in your own sources. But for gnulib, I would say it's
> bloat to define a module for nothing more than a typedef. Especially for
> a type that you can just as well spell out everywhere:
> 
>   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?

Regards,

Oskar Liljeblad (address@hidden)




reply via email to

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