Re: gl_list API

2021-04-18 Thread Ben Pfaff
On Tue, Apr 6, 2021 at 1:30 PM Bruno Haible wrote: > Paul Eggert wrote: > > Yes, that would be portable. But that cast indicates another problem > > with the API. It should return void *, not void const * (think of strchr > > as the model here). > > strchr is a bad model here: You pass it a pointe

Re: gl_list API

2021-04-06 Thread Marc Nieper-Wißkirchen
Am Di., 6. Apr. 2021 um 23:04 Uhr schrieb Bruno Haible : > > > But when designing a general utility, for all kinds of programs to use, > > > it is inappropriate to say "storing null elements is not useful". > > > > I'm afraid we'll have to disagree here. > > In some of my uses of the gl_list modul

Re: gl_list API

2021-04-06 Thread Bruno Haible
> > But when designing a general utility, for all kinds of programs to use, > > it is inappropriate to say "storing null elements is not useful". > > I'm afraid we'll have to disagree here. In some of my uses of the gl_list module, the element is in fact a small integer, cast to an 'uintptr_t' an

Re: gl_list API

2021-04-06 Thread Paul Eggert
On 4/6/21 1:28 PM, Bruno Haible wrote: But when designing a general utility, for all kinds of programs to use, it is inappropriate to say "storing null elements is not useful". I'm afraid we'll have to disagree here. But then I don't use the API so my comments aren't all that important.

Re: gl_list API

2021-04-06 Thread Bruno Haible
ed API to return them > (by setting a bool elsewhere); but usually they aren't. I wanted to avoid this when designing the gl_list API: to have one API for the case that disallows NULLs, and another — more complex — API for that case that allows NULLs. One API function for one thing. No