WARNING: This server is unstable and will be retired in the next days. If you want to keep this forum available, please request immediately a migration on the Nabble Support forum. Forums that don't receive any migration request will be deleted forever.

 « Return to Thread: [RFA libiberty, gdb] Add hashtab support to filename_ncmp.c and use it in gdb.

Re: [RFA libiberty, gdb] Add hashtab support to filename_ncmp.c and use it in gdb.

by Eli Zaretskii :: Rate this Message:

| View in Thread

> Date: Fri, 13 Jul 2012 14:26:15 -0700
> From: Doug Evans <dje@...>
> Cc: dj@..., gcc-patches@..., gdb-patches@...
>
> > 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?

 « Return to Thread: [RFA libiberty, gdb] Add hashtab support to filename_ncmp.c and use it in gdb.