File libgcrypt-FIPS-SLI-Improve-__thread-specifier-check.patch of Package libgcrypt.38414

From 42e8858566e32080aaf818b168f34c698a9ef084 Mon Sep 17 00:00:00 2001
From: NIIBE Yutaka <gniibe@fsij.org>
Date: Thu, 9 Jan 2025 10:15:50 +0900
Subject: [PATCH 2/2] build: Improve __thread specifier check.

* configure.ac (AC_COMPILE_IFELSE __thread): Move the declaration to
global, referring the variable with (void) in main to avoid an error
buidling with -Werror=unused-variable.  Don't need to include
stdlib.h.

--

Reported-by: Lucas Mulling <lucas.mulling@suse.com>
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Signed-off-by: Lucas Mulling <lucas.mulling@suse.com>
---
 configure.ac | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index d708f89a..f38e20c5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1495,8 +1495,9 @@ fi
 AC_CACHE_CHECK([whether compiler supports '__thread' storage class specifier],
        [gcry_cv_gcc_storage_class__thread],
        [gcry_cv_gcc_storage_class__thread=no
-        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <stdlib.h>],
-          [static  __thread  int bar;]
+        AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+          [[static __thread int bar;]],
+          [[(void)bar;]]
           )],
           [gcry_cv_gcc_storage_class__thread=yes])])
 if test "$gcry_cv_gcc_storage_class__thread" = "yes" ; then
-- 
2.47.1

openSUSE Build Service is sponsored by