[clang] [compiler-rt] [libcxx] [clang] Add unistd fortify checks and analyzer size constraints (PR #196499)
Denys Fedoryshchenko via llvm-commits
llvm-commits at lists.llvm.org
Tue May 12 02:15:36 PDT 2026
================
@@ -370,3 +370,61 @@ void test_file_fd_at_functions() {
(void)readlinkat(AT_FDCWD, "newpath", Buf, 10);
(void)renameat(AT_FDCWD, "oldpath", AT_FDCWD, "newpath");
}
+
+#define SSIZE_MAX_PLUS_ONE ((size_t)1 << (sizeof(size_t) * __CHAR_BIT__ - 1))
+
+void test_read_ssize_max_io_size(int fd, char *Buf) {
+ read(fd, Buf, SSIZE_MAX_PLUS_ONE); // \
+ // report-warning{{The 3rd argument to 'read' is 9223372036854775808 but should be a value not greater than SSIZE_MAX}} \
----------------
nuclearcat wrote:
Same as previous, fixing, sorry for noise.
https://github.com/llvm/llvm-project/pull/196499
More information about the llvm-commits
mailing list