aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2022-03-25 09:01:48 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2022-03-31 09:02:41 -0300
commit692c2571c8b2b707704661bf1cfd2de3b3ab8cff (patch)
treef793f37ebc9e298e2b663982c03e0521e92bbe8b
parent1dedc5bd5cc43173e0f7d7e010398ff46139e1dd (diff)
downloadglibc-692c2571c8b2b707704661bf1cfd2de3b3ab8cff.zip
glibc-692c2571c8b2b707704661bf1cfd2de3b3ab8cff.tar.gz
glibc-692c2571c8b2b707704661bf1cfd2de3b3ab8cff.tar.bz2
nptl: Use libc-diag.h with tst-thread-setspecific
And also use libsupport. Checked on x86_64-linux-gnu and i686-linux-gnu.
-rw-r--r--nptl/tst-thread-setspecific.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/nptl/tst-thread-setspecific.c b/nptl/tst-thread-setspecific.c
index 8f25c6f..bdfa583 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>