[bug-gnulib] Re: [PATCH]: fix warning in the hash module

2005-05-20 Thread Bruno Haible
Jim Meyering wrote: > What if we were to convert to the const-less signatures you prefer, > and then an application wants to call hash_insert with a variable of > type `char const *'? -- of course, the key-freer function is NULL > in that case. Then, it's not just the relatively obscure -Wcast-qua

[bug-gnulib] Re: [PATCH]: fix warning in the hash module

2005-05-19 Thread Yoann Vandoorselaere
On Thu, 2005-05-19 at 12:46 +0100, Ian Abbott wrote: > On 19/05/2005 11:18, Yoann Vandoorselaere wrote: > > On Thu, 2005-05-19 at 10:47 +0100, Ian Abbott wrote: > > > >>On 18/05/2005 19:29, Yoann Vandoorselaere wrote: > >>>It is not. The point was that the interface allow the user to specify a > >

[bug-gnulib] Re: [PATCH]: fix warning in the hash module

2005-05-19 Thread Ian Abbott
On 19/05/2005 11:18, Yoann Vandoorselaere wrote: On Thu, 2005-05-19 at 10:47 +0100, Ian Abbott wrote: On 18/05/2005 19:29, Yoann Vandoorselaere wrote: It is not. The point was that the interface allow the user to specify a callback for freeing the data, and thus the pointer to theses data should no

[bug-gnulib] Re: [PATCH]: fix warning in the hash module

2005-05-19 Thread Yoann Vandoorselaere
On Thu, 2005-05-19 at 10:47 +0100, Ian Abbott wrote: > On 18/05/2005 19:29, Yoann Vandoorselaere wrote: > > On Wed, 2005-05-18 at 16:16 +0100, Ian Abbott wrote: > > > >>On 17/05/2005 10:20, Yoann Vandoorselaere wrote: > >> > >>>However, I still consider this version of the patch to be a hack, when

[bug-gnulib] Re: [PATCH]: fix warning in the hash module

2005-05-19 Thread Ian Abbott
On 18/05/2005 19:29, Yoann Vandoorselaere wrote: On Wed, 2005-05-18 at 16:16 +0100, Ian Abbott wrote: On 17/05/2005 10:20, Yoann Vandoorselaere wrote: However, I still consider this version of the patch to be a hack, when the real bug here is that you should not use const since you permit the user

Re: [bug-gnulib] Re: [PATCH]: fix warning in the hash module

2005-05-18 Thread Yoann Vandoorselaere
On Wed, 2005-05-18 at 16:16 +0100, Ian Abbott wrote: > On 17/05/2005 10:20, Yoann Vandoorselaere wrote: > > However, I still consider this version of the patch to be a hack, when > > the real bug here is that you should not use const since you permit the > > user to free() the data from the interfa

[bug-gnulib] Re: [PATCH]: fix warning in the hash module

2005-05-18 Thread Ian Abbott
On 17/05/2005 10:20, Yoann Vandoorselaere wrote: However, I still consider this version of the patch to be a hack, when the real bug here is that you should not use const since you permit the user to free() the data from the interface callback. The interface should not use const at all. Can you sho

[bug-gnulib] Re: [PATCH]: fix warning in the hash module

2005-05-17 Thread Jim Meyering
Yoann Vandoorselaere <[EMAIL PROTECTED]> wrote: > On Tue, 2005-05-17 at 14:21 +0200, Jim Meyering wrote: >> Yoann Vandoorselaere <[EMAIL PROTECTED]> wrote: ... > This requirement is technically wrong since you allow modification of > the input argument through the user provided callback. I am well

[bug-gnulib] Re: [PATCH]: fix warning in the hash module

2005-05-17 Thread Yoann Vandoorselaere
On Mon, 2005-05-16 at 15:20 +0200, Jim Meyering wrote: > Yoann Vandoorselaere <[EMAIL PROTECTED]> wrote: > > This patch fix constness warning in the GnuLib hash module. > > I'm all for avoiding warnings, but not when it detracts from what I > think of as the correctness of an interface, as it woul

[bug-gnulib] Re: [PATCH]: fix warning in the hash module

2005-05-17 Thread Yoann Vandoorselaere
On Tue, 2005-05-17 at 08:59 +0200, Jim Meyering wrote: > Yoann Vandoorselaere <[EMAIL PROTECTED]> wrote: > > On Mon, 2005-05-16 at 15:20 +0200, Jim Meyering wrote: > >> Yoann Vandoorselaere <[EMAIL PROTECTED]> wrote: > >> > This patch fix constness warning in the GnuLib hash module. > >> > >> I'm

[bug-gnulib] Re: [PATCH]: fix warning in the hash module

2005-05-17 Thread Yoann Vandoorselaere
On Tue, 2005-05-17 at 14:21 +0200, Jim Meyering wrote: > Yoann Vandoorselaere <[EMAIL PROTECTED]> wrote: > >> > This patch fix constness warning in the GnuLib hash module. > > That patch fixes three of the four warnings produced by gcc -Wcast-qual. > The final one is here: > > void * > hash_i

[bug-gnulib] Re: [PATCH]: fix warning in the hash module

2005-05-17 Thread Jim Meyering
Yoann Vandoorselaere <[EMAIL PROTECTED]> wrote: > On Mon, 2005-05-16 at 15:20 +0200, Jim Meyering wrote: >> Yoann Vandoorselaere <[EMAIL PROTECTED]> wrote: >> > This patch fix constness warning in the GnuLib hash module. >> >> I'm all for avoiding warnings, but not when it detracts from what I >> t

[bug-gnulib] Re: [PATCH]: fix warning in the hash module

2005-05-17 Thread Jim Meyering
Yoann Vandoorselaere <[EMAIL PROTECTED]> wrote: >> > This patch fix constness warning in the GnuLib hash module. That patch fixes three of the four warnings produced by gcc -Wcast-qual. The final one is here: void * hash_insert (Hash_table *table, const void *entry) { ... return (v

[bug-gnulib] Re: [PATCH]: fix warning in the hash module

2005-05-17 Thread Jim Meyering
Yoann Vandoorselaere <[EMAIL PROTECTED]> wrote: > This patch fix constness warning in the GnuLib hash module. I'm all for avoiding warnings, but not when it detracts from what I think of as the correctness of an interface, as it would in this case. Those `const void *entry' parameters constitute