diff mbox series

[09/12] posix/conformance/interfaces/pthread_*_destroy: Suppress nonnull warning

Message ID 20211119074602.857595-10-lkml@jv-coder.de
State Accepted
Headers show
Series Fix or suppress compiler warnings in posix/conformance/interfaces | expand

Commit Message

Joerg Vehlow Nov. 19, 2021, 7:45 a.m. UTC
From: Joerg Vehlow <joerg.vehlow@aox-tech.de>

These two tests are specifically testing passing NULL to the functions,
so we supress the error message at least for gcc.

Signed-off-by: Joerg Vehlow <joerg.vehlow@aox-tech.de>
---
 .../conformance/interfaces/pthread_condattr_destroy/4-1.c      | 3 +++
 .../conformance/interfaces/pthread_mutexattr_destroy/4-1.c     | 3 +++
 2 files changed, 6 insertions(+)

Comments

Cyril Hrubis Nov. 19, 2021, 3:35 p.m. UTC | #1
Hi!
Applied, thanks.
diff mbox series

Patch

diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_destroy/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_destroy/4-1.c
index d0aa32f8a..6205d8d29 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_destroy/4-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_destroy/4-1.c
@@ -15,6 +15,9 @@ 
  *
  */
 
+/* This test explicitly tries to pass null to a parameter, that should not be NULL */
+#pragma GCC diagnostic ignored "-Wnonnull"
+
 #include <pthread.h>
 #include <stdio.h>
 #include <errno.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_destroy/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_destroy/4-1.c
index 094739030..cad698012 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_destroy/4-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_destroy/4-1.c
@@ -15,6 +15,9 @@ 
  *
  */
 
+/* This test explicitly tries to pass null to a parameter, that should not be NULL */
+#pragma GCC diagnostic ignored "-Wnonnull"
+
 #include <pthread.h>
 #include <stdio.h>
 #include <errno.h>