Nullability check for stdlib module.
Bugs: b/245972273
Test: None
Change-Id: Ib33a5359a924c21888f268158c4d7f824740dd55
diff --git a/tests/clang_fortify_tests.cpp b/tests/clang_fortify_tests.cpp
index 40cb83f..544af43 100644
--- a/tests/clang_fortify_tests.cpp
+++ b/tests/clang_fortify_tests.cpp
@@ -387,6 +387,8 @@
}
static void testStdlib() {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wnonnull"
char path_buffer[PATH_MAX - 1];
// expected-warning@+2{{ignoring return value of function}}
// expected-error@+1{{must be NULL or a pointer to a buffer with >= PATH_MAX bytes}}
@@ -401,6 +403,7 @@
// expected-warning@+2{{ignoring return value of function}}
// expected-error@+1{{flipped arguments?}}
realpath(nullptr, nullptr);
+#pragma clang diagnostic pop
}
} // namespace compilation_tests
#endif