|
From: | Paul Eggert |
Subject: | Re: [PATCH] full-read, etc.: prefer signed types |
Date: | Fri, 9 Aug 2024 14:59:59 -0700 |
User-agent: | Mozilla Thunderbird |
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.
[Prev in Thread] | Current Thread | [Next in Thread] |