Re: indsize: New module

2020-12-04 Thread Paul Eggert
On 12/3/20 6:29 PM, Bruno Haible wrote: +/* Note: ISO C does not mandate that 'size_t' and 'ptrdiff_t' have the same + size, but it is so an all platforms we have seen since 1990. */ Thanks for the change. This prompted me to re-read the intprops documentation and (among other things) upda

Re: indsize: New module

2020-12-03 Thread Bruno Haible
Paul Eggert wrote: > > For this reason I see the choice of a signed type as an_implementation_ > > detail. > > It's a crucial detail and it belongs in the API. I not not want to waste time > worrying whether idx_t is signed in any code that uses idx_t, as > signed-vs-unsigned problems are ende

Re: indsize: New module

2020-12-03 Thread Paul Eggert
On 12/3/20 2:02 PM, Bruno Haible wrote: For this reason I see the choice of a signed type as an_implementation_ detail. It's a crucial detail and it belongs in the API. I not not want to waste time worrying whether idx_t is signed in any code that uses idx_t, as signed-vs-unsigned problems a

Re: indsize: New module

2020-12-03 Thread Bruno Haible
Hi Paul, > > /* The user can define UNSIGNED_INDSIZE_T, to get a different set of > > compiler > > warnings. */ > > I'm leery of this complexity, as it would change the semantics of what the > type > means. The type is not just about compiler warnings; it's about preferring > signed inte

Re: indsize: New module

2020-12-03 Thread Paul Eggert
On 12/3/20 6:25 AM, Bruno Haible wrote: /* The user can define UNSIGNED_INDSIZE_T, to get a different set of compiler warnings. */ I'm leery of this complexity, as it would change the semantics of what the type means. The type is not just about compiler warnings; it's about preferring si

indsize: New module

2020-12-03 Thread Bruno Haible
it means "rpath and dest are pointers into possibly different memory objects", whereas when we write indsize_t dest_offset = dest - rpath; it means "rpath and dest are pointers into the same memory object, and rpath <= dest". Here's the proposed patch. 2020-12-03