[clang] [clang][StaticAnalyzer] Adding getentropy to CStringChecker. (PR #83675)

Balazs Benics via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 8 05:08:00 PST 2024


================
@@ -529,3 +529,42 @@ void nocrash_on_locint_offset(void *addr, void* from, struct S s) {
   size_t iAdd = (size_t) addr;
   memcpy(((void *) &(s.f)), from, iAdd);
 }
+
+#if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__)
+/* present in both glibc 2.25 and musl 1.1.20 */
+
+//===----------------------------------------------------------------------===
+// getentropy()
+//===----------------------------------------------------------------------===
----------------
steakhal wrote:

If you prefer to keep this header, make it 81 chars wide.
```suggestion
//===----------------------------------------------------------------------===//
// getentropy()
//===----------------------------------------------------------------------===//
```

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


More information about the cfe-commits mailing list