[libcxx-commits] [PATCH] D114563: [libc++] Fix ssize test that made an assumption about ptrdiff_t

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Nov 24 14:02:27 PST 2021


ldionne added a comment.

In D114563#3152482 <https://reviews.llvm.org/D114563#3152482>, @mstorsjo wrote:

>> returns a type that is larger than ptrdiff_t,
>
>
>
>> where ptrdiff_t is int, but size_t is still unsigned long. As a result, std::ssize returns long
>
> Unless this is a _really_ special platform, isn't long just 32 bits in this setup? I.e. `sizeof(ptrdiff_t) == sizeof(ssize_t)`, (and `sizeof(int) == sizeof(long)`), but the root cause is that `int` and `long` are two distinct different types even if their sizes happen to match?

You are right! I'm editing my commit message.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114563/new/

https://reviews.llvm.org/D114563



More information about the libcxx-commits mailing list