On 2024-08-09 14:56, Bruno Haible wrote:
But why also for full-read and full-write? These have a calling convention like fread() and fwrite() — a result < count is an error —, and fread() and fwrite() return size_t.
It's for the same reason I'm gradually switching to idx_t elsewhere. In well-controlled apps object sizes cannot exceed PTRDIFF_MAX so there's no generality loss in replacing size_t with idx_t. And there's a win in switching, because idx_t arithmetic is less error-prone.