This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFA libiberty, gdb] Add hashtab support to filename_ncmp.c and use it in gdb.
> Date: Fri, 13 Jul 2012 14:26:15 -0700
> From: Doug Evans <dje@google.com>
> Cc: dj@redhat.com, gcc-patches@gcc.gnu.org, gdb-patches@sourceware.org
>
> > Sorry if I'm missing something, but why do we need to advertise such a
> > function at all? Given that libiberty already provides filename_cmp,
> > isn't it trivial to write something like filename_eq whenever someone
> > needs to use hashes of file names?
>
> It's a "matched set" with filename_hash.
> The hashtab.c constructors take a hash_f function pointer and an eq_f
> function pointer.
I understand all that, but why would the eq_f function need to be an
external function on its own?
E.g., if we were to write a qsort replacement, would we have a
suitable string comparison function declared extern, when it is a
trivial wrapper around strcmp?