On Thu, 11 Jan 2024, Antonin Décimo wrote:
It is sufficient to specify the section on the symbol declaration.
Signed-off-by: Antonin Décimo <anto...@tarides.com>
---
mingw-w64-libraries/winpthreads/src/thread.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/mingw-w64-libraries/winpthreads/src/thread.c
b/mingw-w64-libraries/winpthreads/src/thread.c
index 245bc52a6..a0bd711d1 100644
--- a/mingw-w64-libraries/winpthreads/src/thread.c
+++ b/mingw-w64-libraries/winpthreads/src/thread.c
@@ -533,8 +533,9 @@ __dyn_tls_pthread (HANDLE hDllHandle, DWORD dwReason,
LPVOID lpreserved)
# pragma section(".CRT$XLF", long, read)
#endif
-extern const PIMAGE_TLS_CALLBACK
WINPTHREADS_ATTRIBUTE((WINPTHREADS_SECTION(".CRT$XLF"))) __xl_f;
-const PIMAGE_TLS_CALLBACK
WINPTHREADS_ATTRIBUTE((WINPTHREADS_SECTION(".CRT$XLF"))) __xl_f =
__dyn_tls_pthread;
+WINPTHREADS_ATTRIBUTE((WINPTHREADS_SECTION(".CRT$XLF")))
+extern const PIMAGE_TLS_CALLBACK __xl_f;
+const PIMAGE_TLS_CALLBACK __xl_f = __dyn_tls_pthread;
Why do we need to declare the variable beforehand here at all? Do we build
the code with warnings enabled for defining symbols without them being
declared before?
(The same question goes for these constructs in patch 6/8 as well.)
// Martin
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public