[clang] [compiler-rt] [libcxx] [clang][Sema] Add fortify warnings for `unistd.h` (PR #161737)

Colin Kinloch via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 15 15:12:17 PST 2026


ColinKinloch wrote:

One of the diagnostics I'm in the process of porting is to check the `count` argument of `read`, `pwrite`, etc. against `SSIZE_MAX` to validate that the size requested operation doesn't exceed the platforms maximum operation size.

Alongside a lookup for platform specific values (max signed long on darwin, signed size type on glibc) I'm trying to infer the value of `SSIZE_MAX` by checking the size of the return type of the function (ssize_t). However if I've set it as a builtin will that always be the same? And would the builtin function necessarily match the platforms signature?

https://github.com/llvm/llvm-project/pull/161737


More information about the cfe-commits mailing list