public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [COMMITTED] S390: Fix werror=unused-variable in ifunc-impl-list.c.
@ 2022-08-18  7:12 Stefan Liebler
  0 siblings, 0 replies; only message in thread
From: Stefan Liebler @ 2022-08-18  7:12 UTC (permalink / raw)
  To: libc-alpha; +Cc: Stefan Liebler

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 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sysdeps/s390/multiarch/ifunc-impl-list.c b/sysdeps/s390/multiarch/ifunc-impl-list.c
index 5d0c73094d..7bee54351c 100644
--- a/sysdeps/s390/multiarch/ifunc-impl-list.c
+++ b/sysdeps/s390/multiarch/ifunc-impl-list.c
@@ -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);
-- 
2.37.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-08-18  7:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-18  7:12 [COMMITTED] S390: Fix werror=unused-variable in ifunc-impl-list.c Stefan Liebler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).