public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] Do not use array parameter to new_composite_name (bug 26726)
@ 2020-10-30 21:39 Joseph Myers
  0 siblings, 0 replies; only message in thread
From: Joseph Myers @ 2020-10-30 21:39 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=5c3b0374ebe0aa4b0a434c0addb4c455886a0986

commit 5c3b0374ebe0aa4b0a434c0addb4c455886a0986
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Fri Oct 30 21:39:12 2020 +0000

    Do not use array parameter to new_composite_name (bug 26726)
    
    Among the warnings causing a glibc build with GCC 11 to fail is one
    for a call new_composite_name in setlocale.c.  The newnames argument
    is declared as an array with __LC_LAST elements, but when the category
    argument is not LC_ALL, it actually only has one element.  Since the
    number of elements depends on the first argument to the function, it
    seems clearer to declare the argument as a pointer.
    
    Tested with build-many-glibcs.py for arm-linux-gnueabi, where this
    allows the build to get further.
    
    Reviewed-by: DJ Delorie <dj@redhat.com>

Diff:
---
 locale/setlocale.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/locale/setlocale.c b/locale/setlocale.c
index 030f1727bd..89e8724af3 100644
--- a/locale/setlocale.c
+++ b/locale/setlocale.c
@@ -135,7 +135,7 @@ extern int _nl_msg_cat_cntr;
 
 /* Construct a new composite name.  */
 static char *
-new_composite_name (int category, const char *newnames[__LC_LAST])
+new_composite_name (int category, const char **newnames)
 {
   size_t last_len = 0;
   size_t cumlen = 0;


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

only message in thread, other threads:[~2020-10-30 21:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-30 21:39 [glibc] Do not use array parameter to new_composite_name (bug 26726) Joseph Myers

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).