Does in glibc, the sizeof(ssize_t) always equals to sizeof(size_t)
Yonggang Luo
luoyonggang@gmail.com
Fri May 22 04:21:09 GMT 2026
On Fri, May 22, 2026 at 3:59 AM Paul Eggert <eggert@cs.ucla.edu> wrote:
>
> On 2026-05-21 10:58, Yonggang Luo wrote:
> > So I have this question, to collect it all POSIX implementation have
> > sizeof(ssize_t)==sizeof(size_t)
>
> The only POSIXish platforms I know of that did this (OSF/1, UNICOS, late
> old AmigaOS/AROS/MorphOS, old TRON) are long dead.
>
> What's the motivation here? Do you want to prohibit implementations
> where sizeof (size_t) < sizeof (ssize_t), and if so, why? Also, will you
> prescribe sizeof (ptrdiff_t) too?
The motivation is to introduce ssize_t into C2Y as the signed version
of size_t because of the
broad usage of ssize_t. I prohibit implementations where sizeof
(size_t) != sizeof (ssize_t)(not just sizeof (size_t) < sizeof
(ssize_t)).
sizeof (ptrdiff_t) is not a concern because it's already in C23, and
because ptrdiff_t is not widely used.
--
此致
礼
罗勇刚
Yours
sincerely,
Yonggang Luo
More information about the Libc-alpha
mailing list