]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Do not use array parameter to new_composite_name (bug 26726)
authorJoseph Myers <joseph@codesourcery.com>
Fri, 30 Oct 2020 21:39:12 +0000 (21:39 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Fri, 30 Oct 2020 21:39:12 +0000 (21:39 +0000)
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>
locale/setlocale.c

index 030f1727bd61263d4215d0259637b8f9748574c4..89e8724af31cce113411d4fe0be28ea036c523fa 100644 (file)
@@ -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;