bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

threads-h tests: Fix gcc -Wold-style-declaration warning


From: Bruno Haible
Subject: threads-h tests: Fix gcc -Wold-style-declaration warning
Date: Mon, 04 Sep 2023 16:40:26 +0200

These gcc warnings are justified:

test-thread_local.c:87:1: warning: '__thread' is not at beginning of 
declaration [-Wold-style-declaration]
test-thread_local.c:88:1: warning: '__thread' is not at beginning of 
declaration [-Wold-style-declaration]
test-thread_local.c:89:1: warning: '__thread' is not at beginning of 
declaration [-Wold-style-declaration]
test-thread_local.c:90:1: warning: '__thread' is not at beginning of 
declaration [-Wold-style-declaration]

Fixed like this:


2023-09-04  Bruno Haible  <bruno@clisp.org>

        threads-h tests: Fix gcc -Wold-style-declaration warning.
        * tests/test-thread_local.c (value0, value1, value2, value3): Put the
        'thread_local' storage class specifier before the type.

diff --git a/tests/test-thread_local.c b/tests/test-thread_local.c
index c30ad10238..28536535ff 100644
--- a/tests/test-thread_local.c
+++ b/tests/test-thread_local.c
@@ -84,10 +84,10 @@ perhaps_yield (void)
 /* ----------------------- Test thread-local storage ----------------------- */
 
 #define KEYS_COUNT 4
-static unsigned int thread_local value0;
-static unsigned int thread_local value1;
-static unsigned int thread_local value2;
-static unsigned int thread_local value3;
+static thread_local unsigned int value0;
+static thread_local unsigned int value1;
+static thread_local unsigned int value2;
+static thread_local unsigned int value3;
 
 static int
 worker_thread (void *arg)






reply via email to

[Prev in Thread] Current Thread [Next in Thread]