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