diff mbox series

[COMMITTED] nptl: Use libc-diag.h with tst-thread-setspecific

Message ID 20220331121206.1537166-1-adhemerval.zanella@linaro.org
State New
Headers show
Series [COMMITTED] nptl: Use libc-diag.h with tst-thread-setspecific | expand

Commit Message

Adhemerval Zanella Netto March 31, 2022, 12:12 p.m. UTC
And also use libsupport.

Checked on x86_64-linux-gnu and i686-linux-gnu.
---
 nptl/tst-thread-setspecific.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/nptl/tst-thread-setspecific.c b/nptl/tst-thread-setspecific.c
index 8f25c6f7ce..bdfa583efc 100644
--- a/nptl/tst-thread-setspecific.c
+++ b/nptl/tst-thread-setspecific.c
@@ -19,15 +19,17 @@ 
 
 #include <pthread.h>
 #include <stdlib.h>
+#include <libc-diag.h>
 
 /* Turn uninitialized warnings into errors to detect the problem.
    See BZ #27714.  */
 
-#pragma GCC diagnostic push
-#pragma GCC diagnostic error "-Wmaybe-uninitialized"
-#pragma GCC diagnostic error "-Wuninitialized"
+DIAG_PUSH_NEEDS_COMMENT;
+DIAG_IGNORE_NEEDS_COMMENT (6, "-Wmaybe-uninitialized");
+DIAG_IGNORE_NEEDS_COMMENT (6, "-Wuninitialized");
 
-int do_test (void)
+static int
+do_test (void)
 {
   void *p = malloc (1);   /* Deliberately uninitialized.  */
   pthread_setspecific (pthread_self (), p);
@@ -37,7 +39,6 @@  int do_test (void)
   return p == q;
 }
 
-#pragma GCC diagnostic pop
+DIAG_POP_NEEDS_COMMENT;
 
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>