================
@@ -3760,6 +3846,19 @@ def VFork : LibBuiltin<"unistd.h"> {
let Prototype = "pid_t()";
}
+// unistd.h I/O functions (read/write/pread/pwrite/readlink/readlinkat/getcwd)
+// are intentionally not declared as builtins.
+// * "read", "write", "readlink", "readlinkat", and "getcwd" are common
+// identifiers (or names that appear in asm-label wrappers); declaring them
+// as Clang builtins makes harmless local declarations trigger
+// -Wincompatible-library-redeclaration (an error under -Werror).
+// * pread/pwrite prototypes use off_t, whose width is platform- and
+// macro-dependent (notably _FILE_OFFSET_BITS); a fixed builtin signature
+// would clash with the system header on some targets.
+// Fortify checks for all of these are dispatched by name in
+// Sema::checkFortifiedBuiltinMemoryFunction, gated on a full prototype
+// match against the POSIX signature.
+
----------------
ojhunt wrote:
was this comment requested elsewhere?
https://github.com/llvm/llvm-project/pull/196499
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits