1From 14e932fe817492a2a053b6b3e912210b1a9a5a2c Mon Sep 17 00:00:00 2001
2From: Joseph Myers <joseph@codesourcery.com>
3Date: Fri, 30 Oct 2020 21:39:12 +0000
4Subject: [PATCH 06/20] Do not use array parameter to new_composite_name (bug
5 26726)
6
7Among the warnings causing a glibc build with GCC 11 to fail is one
8for a call new_composite_name in setlocale.c.  The newnames argument
9is declared as an array with __LC_LAST elements, but when the category
10argument is not LC_ALL, it actually only has one element.  Since the
11number of elements depends on the first argument to the function, it
12seems clearer to declare the argument as a pointer.
13
14Tested with build-many-glibcs.py for arm-linux-gnueabi, where this
15allows the build to get further.
16
17Reviewed-by: DJ Delorie <dj@redhat.com>
18(cherry picked from commit 5c3b0374ebe0aa4b0a434c0addb4c455886a0986)
19Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
20---
21 locale/setlocale.c | 2 +-
22 1 file changed, 1 insertion(+), 1 deletion(-)
23
24diff --git a/locale/setlocale.c b/locale/setlocale.c
25index e4de907e..6d160c9c 100644
26--- a/locale/setlocale.c
27+++ b/locale/setlocale.c
28@@ -137,7 +137,7 @@ extern int _nl_msg_cat_cntr;
29
30 /* Construct a new composite name.  */
31 static char *
32-new_composite_name (int category, const char *newnames[__LC_LAST])
33+new_composite_name (int category, const char **newnames)
34 {
35   size_t last_len = 0;
36   size_t cumlen = 0;
37--
382.20.1
39
40