]> sourceware.org Git - glibc.git/commitdiff
S390: Fix werror=unused-variable in ifunc-impl-list.c.
authorStefan Liebler <stli@linux.ibm.com>
Thu, 18 Aug 2022 07:10:48 +0000 (09:10 +0200)
committerStefan Liebler <stli@linux.ibm.com>
Thu, 18 Aug 2022 07:10:48 +0000 (09:10 +0200)
If the architecture level set is high enough, no IFUNCs are used at
all and the variable i would be unused.  Then the build fails with:
../sysdeps/s390/multiarch/ifunc-impl-list.c: In function ‘__libc_ifunc_impl_list’:
../sysdeps/s390/multiarch/ifunc-impl-list.c:76:10: error: unused variable ‘i’ [-Werror=unused-variable]
   76 |   size_t i = max;
      |          ^
cc1: all warnings being treated as errors

sysdeps/s390/multiarch/ifunc-impl-list.c

index 5d0c73094d127dad2bc2ba7ac1a2d339c41af948..7bee54351c5b8df6f99d2bedc67a93c5427e1ab9 100644 (file)
@@ -73,7 +73,9 @@ size_t
 __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
                        size_t max)
 {
-  size_t i = max;
+  /* If the architecture level set is high enough, no IFUNCs are used at all
+     and the variable i would be unused.  */
+  size_t i __attribute__ ((unused)) = max;
 
   /* Get hardware information.  */
   unsigned long int dl_hwcap = GLRO (dl_hwcap);
This page took 0.045475 seconds and 5 git commands to generate.