[clang] [analyzer] Report violations of the "returns_nonnull" attribute (PR #106048)

Arseniy Zaostrovnykh via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 27 00:05:57 PDT 2024


================
@@ -51,3 +54,15 @@ int *cannot_return_null() {
 __attribute__((returns_nonnull)) int *passthrough(int *p) {
   return p; // no-warning: we have no evidence that `p` is null, i.e., violating the contract
 }
+
+__attribute__((noreturn))
+void exit(int);
----------------
necto wrote:

It is not used, indeed; thanks for spotting it!
It was relevant in one of the working versions of the test case, but not in the committed one. Removed in 41956123

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


More information about the cfe-commits mailing list