]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
nptl: Use libc-diag.h with tst-thread-setspecific
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Fri, 25 Mar 2022 12:01:48 +0000 (09:01 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 31 Mar 2022 12:02:41 +0000 (09:02 -0300)
And also use libsupport.

Checked on x86_64-linux-gnu and i686-linux-gnu.

nptl/tst-thread-setspecific.c

index 8f25c6f7ce39c111e9b4e5f90e107720d9302c0d..bdfa583efcc825f6fc8cd126d303ef288826c428 100644 (file)
 
 #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>