diff --git a/backport-clang-0001-configure-remove-overly-restrictive-check-for-clang.patch b/backport-clang-0001-configure-remove-overly-restrictive-check-for-clang.patch new file mode 100644 index 0000000000000000000000000000000000000000..3177ada1540ed4fe4971af5bc8d55b5c4a978282 --- /dev/null +++ b/backport-clang-0001-configure-remove-overly-restrictive-check-for-clang.patch @@ -0,0 +1,56 @@ +From 734537e38073874b04af16127181edc403d9ac39 Mon Sep 17 00:00:00 2001 +From: Fangrui Song +Date: Sat, 25 Sep 2021 22:03:08 -0700 +Subject: [PATCH] configure: remove overly restrictive check for clang + +--- + configure | 4 ++-- + configure.ac | 4 ++-- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/configure b/configure +index 9b38fae7a1..90c1f2ddaa 100755 +--- a/configure ++++ b/configure +@@ -5724,7 +5724,7 @@ int + main (void) + { + +-#if !defined __GNUC__ || __GNUC__ < 6 || (__GNUC__ == 6 && __GNUC_MINOR__ < 2) ++#if (__GNUC__ < 6 || (__GNUC__ == 6 && __GNUC_MINOR__ < 2)) && !defined __clang__ + #error insufficient compiler + #endif + ; +@@ -7367,7 +7367,7 @@ else $as_nop + extern char *strstr (const char *, const char *) __asm ("my_strstr"); + char *foo (const char *a, const char *b) + { +- return __builtin_strstr (a, b); ++ return strstr (a, b); + } + EOF + if { ac_try='${CC-cc} -O3 -S conftest.c -o - | grep -F "my_strstr" > /dev/null' +diff --git a/configure.ac b/configure.ac +index ea5bb07655..edf7c21a20 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -599,7 +599,7 @@ AC_CHECK_PROG_VER(BISON, bison, --version, + + AC_CACHE_CHECK([if $CC is sufficient to build libc], libc_cv_compiler_ok, [ + AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[]], [[ +-#if !defined __GNUC__ || __GNUC__ < 6 || (__GNUC__ == 6 && __GNUC_MINOR__ < 2) ++#if (__GNUC__ < 6 || (__GNUC__ == 6 && __GNUC_MINOR__ < 2)) && !defined __clang__ + #error insufficient compiler + #endif]])], + [libc_cv_compiler_ok=yes], +@@ -1485,7 +1485,7 @@ cat > conftest.c <<\EOF + extern char *strstr (const char *, const char *) __asm ("my_strstr"); + char *foo (const char *a, const char *b) + { +- return __builtin_strstr (a, b); ++ return strstr (a, b); + } + EOF + dnl +-- +2.39.3 diff --git a/backport-clang-0002-Use-frounding-math-iff-compiler-supports-it.patch b/backport-clang-0002-Use-frounding-math-iff-compiler-supports-it.patch new file mode 100644 index 0000000000000000000000000000000000000000..13641dcf57112d7aefd14446c5f70845fed1d15b --- /dev/null +++ b/backport-clang-0002-Use-frounding-math-iff-compiler-supports-it.patch @@ -0,0 +1,81 @@ +From 242e8c8f9dcb6669613e280a52f20337ba269202 Mon Sep 17 00:00:00 2001 +From: Adhemerval Zanella +Date: Tue, 15 Mar 2022 16:01:29 -0300 +Subject: [PATCH] Use -frounding-math iff compiler supports it + +--- + Makeconfig | 2 +- + configure | 24 ++++++++++++++++++++++++ + configure.ac | 9 +++++++++ + 3 files changed, 34 insertions(+), 1 deletion(-) + +diff --git a/Makeconfig b/Makeconfig +index c48fcc59e8..a908d3e19d 100644 +--- a/Makeconfig ++++ b/Makeconfig +@@ -870,7 +870,7 @@ endif + # We have to assume that glibc functions are called in any rounding + # mode and also change the rounding mode in a few functions. So, + # disable any optimization that assume default rounding mode. +-+math-flags = -frounding-math +++math-flags = $(config-cflags-frounding-math) + + # Logically only "libnldbl", "nonlib" and "testsuite" should be using + # -fno-math-errno. However due to GCC bug #88576, only "libm" can use +diff --git a/configure b/configure +index ff97a7a7b8..9b38fae7a1 100755 +--- a/configure ++++ b/configure +@@ -7466,6 +7466,30 @@ printf "%s\n" "$libc_cv_cc_signaling_nans" >&6; } + config_vars="$config_vars + config-cflags-signaling-nans = $libc_cv_cc_signaling_nans" + ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for compiler option -frounding-math" >&5 ++printf %s "checking for compiler option -frounding-math... " >&6; } ++if test ${libc_cv_cc_rounding_math+y} ++then : ++ printf %s "(cached) " >&6 ++else $as_nop ++ if { ac_try='${CC-cc} -Werror -frounding-math -xc /dev/null -S -o /dev/null' ++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; } ++then : ++ libc_cv_cc_rounding_math=-frounding-math ++else $as_nop ++ libc_cv_cc_rounding_math= ++fi ++ ++fi ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cc_rounding_math" >&5 ++printf "%s\n" "$libc_cv_cc_rounding_math" >&6; } ++config_vars="$config_vars ++config-cflags-frounding-math = $libc_cv_cc_rounding_math" ++ + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC accepts -fno-tree-loop-distribute-patterns with \ + __attribute__ ((__optimize__))" >&5 + printf %s "checking if $CC accepts -fno-tree-loop-distribute-patterns with \ +diff --git a/configure.ac b/configure.ac +index cac41e728e..ea5bb07655 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1534,6 +1534,15 @@ LIBC_TRY_CC_OPTION([-Werror -fsignaling-nans], + LIBC_CONFIG_VAR([config-cflags-signaling-nans], + [$libc_cv_cc_signaling_nans]) + ++dnl Determina if compiler support -frounding-math ++AC_CACHE_CHECK([for compiler option -frounding-math], libc_cv_cc_rounding_math, [dnl ++LIBC_TRY_CC_OPTION([-Werror -frounding-math], ++ [libc_cv_cc_rounding_math=-frounding-math], ++ [libc_cv_cc_rounding_math=]) ++]) ++LIBC_CONFIG_VAR([config-cflags-frounding-math], ++ [$libc_cv_cc_rounding_math]) ++ + AC_CACHE_CHECK(if $CC accepts -fno-tree-loop-distribute-patterns with \ + __attribute__ ((__optimize__)), libc_cv_cc_loop_to_function, [dnl + cat > conftest.c < +Date: Thu, 7 Oct 2021 18:16:04 -0700 +Subject: [PATCH] Disable __USE_EXTERN_INLINES for clang + +clang does not allow to redefine attributes after function declaration. +Although it work for external usage, its breaks the build for internal +symbol that glibc provides as optimization (for instance bsearch +with stdlib-bsearch.h or __cmsg_nxthdr). + +Disable such optimization for clang while building glibc. +--- + include/features.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/features.h b/include/features.h +index 7c51b4a2e4..a94fc1b3a4 100644 +--- a/include/features.h ++++ b/include/features.h +@@ -515,7 +515,7 @@ + /* Decide whether we can define 'extern inline' functions in headers. */ + #if __GNUC_PREREQ (2, 7) && defined __OPTIMIZE__ \ + && !defined __OPTIMIZE_SIZE__ && !defined __NO_INLINE__ \ +- && defined __extern_inline ++ && defined __extern_inline && !(defined __clang__ && defined _LIBC) + # define __USE_EXTERN_INLINES 1 + #endif + +-- +2.39.3 diff --git a/backport-clang-0004-aarch64-Use-64-bit-variable-to-access-the-special-registers.patch b/backport-clang-0004-aarch64-Use-64-bit-variable-to-access-the-special-registers.patch new file mode 100644 index 0000000000000000000000000000000000000000..9b86c6b55de08c358437a29afdbe77df00be3404 --- /dev/null +++ b/backport-clang-0004-aarch64-Use-64-bit-variable-to-access-the-special-registers.patch @@ -0,0 +1,122 @@ +From 4ccb9ee9dcb043d4eb77de1ca5e5554fb675805f Mon Sep 17 00:00:00 2001 +From: Adhemerval Zanella +Date: Tue, 15 Mar 2022 18:08:21 -0300 +Subject: [PATCH] aarch64: Use 64-bit variable to access the special registers + +clang issues: + + error: value size does not match register size specified by the + constraint and modifier [-Werror,-Wasm-operand-widths] + +while tryng to use 32 bit variables with 'mrs' to get/set the +fpsr, dczid_el0, and ctr. Since all of 64 bit register, use the +expected variable size. +--- + sysdeps/aarch64/fpu/fpu_control.h | 36 +++++++++++++------ + sysdeps/aarch64/fpu/fraiseexcpt.c | 2 +- + sysdeps/aarch64/sfp-machine.h | 2 +- + .../unix/sysv/linux/aarch64/cpu-features.c | 2 +- + sysdeps/unix/sysv/linux/aarch64/sysconf.c | 2 +- + 5 files changed, 29 insertions(+), 15 deletions(-) + +diff --git a/sysdeps/aarch64/fpu/fpu_control.h b/sysdeps/aarch64/fpu/fpu_control.h +index 81ed67151b..4bf14c50bb 100644 +--- a/sysdeps/aarch64/fpu/fpu_control.h ++++ b/sysdeps/aarch64/fpu/fpu_control.h +@@ -29,17 +29,31 @@ + # define _FPU_GETFPSR(fpsr) (fpsr = __builtin_aarch64_get_fpsr ()) + # define _FPU_SETFPSR(fpsr) __builtin_aarch64_set_fpsr (fpsr) + #else +-# define _FPU_GETCW(fpcr) \ +- __asm__ __volatile__ ("mrs %0, fpcr" : "=r" (fpcr)) +- +-# define _FPU_SETCW(fpcr) \ +- __asm__ __volatile__ ("msr fpcr, %0" : : "r" (fpcr)) +- +-# define _FPU_GETFPSR(fpsr) \ +- __asm__ __volatile__ ("mrs %0, fpsr" : "=r" (fpsr)) +- +-# define _FPU_SETFPSR(fpsr) \ +- __asm__ __volatile__ ("msr fpsr, %0" : : "r" (fpsr)) ++# define _FPU_GETCW(fpcr) \ ++ ({ \ ++ unsigned long int __fpcr; \ ++ __asm__ __volatile__ ("mrs %0, fpcr" : "=r" (__fpcr)); \ ++ fpcr = __fpcr; \ ++ }) ++ ++# define _FPU_SETCW(fpcr) \ ++ ({ \ ++ unsigned long int __fpcr = fpcr; \ ++ __asm__ __volatile__ ("msr fpcr, %0" : : "r" (__fpcr)); \ ++ }) ++ ++# define _FPU_GETFPSR(fpsr) \ ++ ({ \ ++ unsigned long int __fpsr; \ ++ __asm__ __volatile__ ("mrs %0, fpsr" : "=r" (__fpsr)); \ ++ fpsr = __fpsr; \ ++ }) ++ ++# define _FPU_SETFPSR(fpsr) \ ++ ({ \ ++ unsigned long int __fpsr = fpsr; \ ++ __asm__ __volatile__ ("msr fpsr, %0" : : "r" (__fpsr)); \ ++ }) + #endif + + /* Reserved bits should be preserved when modifying register +diff --git a/sysdeps/aarch64/fpu/fraiseexcpt.c b/sysdeps/aarch64/fpu/fraiseexcpt.c +index 8c674d47d8..1387949ed4 100644 +--- a/sysdeps/aarch64/fpu/fraiseexcpt.c ++++ b/sysdeps/aarch64/fpu/fraiseexcpt.c +@@ -23,7 +23,7 @@ + int + __feraiseexcept (int excepts) + { +- int fpsr; ++ unsigned long int fpsr; + const float fp_zero = 0.0; + const float fp_one = 1.0; + const float fp_max = FLT_MAX; +diff --git a/sysdeps/aarch64/sfp-machine.h b/sysdeps/aarch64/sfp-machine.h +index a9ecdbf961..b4b34e98e9 100644 +--- a/sysdeps/aarch64/sfp-machine.h ++++ b/sysdeps/aarch64/sfp-machine.h +@@ -74,7 +74,7 @@ do { \ + const float fp_1e32 = 1.0e32f; \ + const float fp_zero = 0.0; \ + const float fp_one = 1.0; \ +- unsigned fpsr; \ ++ unsigned long int fpsr; \ + if (_fex & FP_EX_INVALID) \ + { \ + __asm__ __volatile__ ("fdiv\ts0, %s0, %s0" \ +diff --git a/sysdeps/unix/sysv/linux/aarch64/cpu-features.c b/sysdeps/unix/sysv/linux/aarch64/cpu-features.c +index dc09c1c827..bf3196d5e5 100644 +--- a/sysdeps/unix/sysv/linux/aarch64/cpu-features.c ++++ b/sysdeps/unix/sysv/linux/aarch64/cpu-features.c +@@ -82,7 +82,7 @@ init_cpu_features (struct cpu_features *cpu_features) + cpu_features->midr_el1 = midr; + + /* Check if ZVA is enabled. */ +- unsigned dczid; ++ uint64_t dczid; + asm volatile ("mrs %0, dczid_el0" : "=r"(dczid)); + + if ((dczid & DCZID_DZP_MASK) == 0) +diff --git a/sysdeps/unix/sysv/linux/aarch64/sysconf.c b/sysdeps/unix/sysv/linux/aarch64/sysconf.c +index d0fbefa2e9..dcf6cbd68e 100644 +--- a/sysdeps/unix/sysv/linux/aarch64/sysconf.c ++++ b/sysdeps/unix/sysv/linux/aarch64/sysconf.c +@@ -27,7 +27,7 @@ static long int linux_sysconf (int name); + long int + __sysconf (int name) + { +- unsigned ctr; ++ unsigned long int ctr; + + /* Unfortunately, the registers that contain the actual cache info + (CCSIDR_EL1, CLIDR_EL1, and CSSELR_EL1) are protected by the Linux +-- +2.39.3 diff --git a/backport-clang-0005-nptl-Fix-Wincompatible-pointer-types-on-clang.patch b/backport-clang-0005-nptl-Fix-Wincompatible-pointer-types-on-clang.patch new file mode 100644 index 0000000000000000000000000000000000000000..928cdb648dda314b3c9aff1811ecc9f79387289c --- /dev/null +++ b/backport-clang-0005-nptl-Fix-Wincompatible-pointer-types-on-clang.patch @@ -0,0 +1,28 @@ +From 4b710ec0225e68c695b80787b8f932af115fce70 Mon Sep 17 00:00:00 2001 +From: Adhemerval Zanella +Date: Wed, 9 Mar 2022 16:17:43 -0300 +Subject: [PATCH] nptl: Fix Wincompatible-pointer-types on clang + +Clang issues: + +error: incompatible pointer types passing 'struct pthread **' to +parameter of type 'void **' [-Werror,-Wincompatible-pointer-types] +--- + nptl/pthread_join_common.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/nptl/pthread_join_common.c b/nptl/pthread_join_common.c +index 701f6a53c0..0d08c4cb40 100644 +--- a/nptl/pthread_join_common.c ++++ b/nptl/pthread_join_common.c +@@ -29,7 +29,7 @@ cleanup (void *arg) + fail for any reason but the thread not having done that yet so + there is no reason for a loop. */ + struct pthread *self = THREAD_SELF; +- atomic_compare_exchange_weak_acquire (&arg, &self, NULL); ++ atomic_compare_exchange_weak_acquire (&arg, (void **) &self, NULL); + } + + int +-- +2.39.3 diff --git a/backport-clang-0006-stdlib-Remove-Wmaybe-uninitialized-supression-on-setenv.patch b/backport-clang-0006-stdlib-Remove-Wmaybe-uninitialized-supression-on-setenv.patch new file mode 100644 index 0000000000000000000000000000000000000000..83bd58d04a923e3839be1d4ff21a0581da4f89d7 --- /dev/null +++ b/backport-clang-0006-stdlib-Remove-Wmaybe-uninitialized-supression-on-setenv.patch @@ -0,0 +1,43 @@ +From fa16c0a05390efcc6035c3bd945322d03faea7ce Mon Sep 17 00:00:00 2001 +From: Adhemerval Zanella +Date: Wed, 13 Sep 2023 16:55:27 -0300 +Subject: [PATCH] stdlib: Remove -Wmaybe-uninitialized supression on setenv.c + +It is not required on current supported gcc. +--- + stdlib/setenv.c | 13 ++----------- + 1 file changed, 2 insertions(+), 11 deletions(-) + +diff --git a/stdlib/setenv.c b/stdlib/setenv.c +index cc71287fcc..873a699200 100644 +--- a/stdlib/setenv.c ++++ b/stdlib/setenv.c +@@ -19,13 +19,6 @@ + # include + #endif + +-/* Pacify GCC; see the commentary about VALLEN below. This is needed +- at least through GCC 4.9.2. Pacify GCC for the entire file, as +- there seems to be no way to pacify GCC selectively, only for the +- place where it's needed. Do not use DIAG_IGNORE_NEEDS_COMMENT +- here, as it's not defined yet. */ +-#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +- + #include + #if !_LIBC + # if !defined errno && !defined HAVE_ERRNO_DECL +@@ -121,10 +114,8 @@ __add_to_environ (const char *name, const char *value, const char *combined, + + /* Compute lengths before locking, so that the critical section is + less of a performance bottleneck. VALLEN is needed only if +- COMBINED is null (unfortunately GCC is not smart enough to deduce +- this; see the #pragma at the start of this file). Testing +- COMBINED instead of VALUE causes setenv (..., NULL, ...) to dump +- core now instead of corrupting memory later. */ ++ COMBINED is null. Testing COMBINED instead of VALUE causes setenv ++ (..., NULL, ...) to dump core now instead of corrupting memory later. */ + const size_t namelen = strlen (name); + size_t vallen; + if (combined == NULL) +-- +2.39.3 diff --git a/backport-clang-0007-Add-clang-specific-warnings-suppress-macros.patch b/backport-clang-0007-Add-clang-specific-warnings-suppress-macros.patch new file mode 100644 index 0000000000000000000000000000000000000000..a773d3023cf9e951702d18934d11e990f8f8d313 --- /dev/null +++ b/backport-clang-0007-Add-clang-specific-warnings-suppress-macros.patch @@ -0,0 +1,58 @@ +From 9175344b69f63546b020cc150cf1805a3ecbf5e9 Mon Sep 17 00:00:00 2001 +From: Adhemerval Zanella +Date: Tue, 12 Sep 2023 15:45:24 -0300 +Subject: [PATCH] Add clang specific warnings suppress macros + +Four new macros are added: + + * DIAG_{PUSH,POP}_NEEDS_COMMENT_CLANG are similar to + DIAG_{PUSH,POP}_NEEDS_COMMENT, but enable clang specific pragmas to + handle warnings for options only supported by clang. + + * DIAG_IGNORE_NEEDS_COMMENT_{CLANG,GCC} are similar to + DIAG_IGNORE_NEEDS_COMMENT, but enable the warning suppression only + for the referenced compiler. +--- + include/libc-diag.h | 22 ++++++++++++++++++++++ + 1 file changed, 22 insertions(+) + +diff --git a/include/libc-diag.h b/include/libc-diag.h +index dada76a51d..a82e9775dd 100644 +--- a/include/libc-diag.h ++++ b/include/libc-diag.h +@@ -38,6 +38,16 @@ + /* Pop diagnostic state. */ + #define DIAG_POP_NEEDS_COMMENT _Pragma ("GCC diagnostic pop") + ++/* These macros are used to push/pop diagnostic states for warnings only ++ supported by clang. */ ++#ifdef __clang__ ++# define DIAG_PUSH_NEEDS_COMMENT_CLANG _Pragma ("clang diagnostic push") ++# define DIAG_POP_NEEDS_COMMENT_CLANG _Pragma ("clang diagnostic pop") ++#else ++# define DIAG_PUSH_NEEDS_COMMENT_CLANG ++# define DIAG_POP_NEEDS_COMMENT_CLANG ++#endif ++ + #define _DIAG_STR1(s) #s + #define _DIAG_STR(s) _DIAG_STR1(s) + +@@ -71,4 +81,16 @@ + # define DIAG_IGNORE_Os_NEEDS_COMMENT(version, option) + #endif + ++/* Similar to DIAG_IGNORE_NEEDS_COMMENT, these macros should be used ++ to suppress warning supported by the specific compiler. */ ++#ifndef __clang__ ++# define DIAG_IGNORE_NEEDS_COMMENT_GCC(VERSION, WARNING) \ ++ DIAG_IGNORE_NEEDS_COMMENT (VERSION, WARNING) ++# define DIAG_IGNORE_NEEDS_COMMENT_CLANG(version, option) ++#else ++# define DIAG_IGNORE_NEEDS_COMMENT_GCC(VERSION, WARNING) ++# define DIAG_IGNORE_NEEDS_COMMENT_CLANG(version, option) \ ++ _Pragma (_DIAG_STR (clang diagnostic ignored option)) ++#endif ++ + #endif /* libc-diag.h */ +-- +2.39.3 diff --git a/backport-clang-0008-Suppress-Wmaybe-uninitialized-only-for-gcc.patch b/backport-clang-0008-Suppress-Wmaybe-uninitialized-only-for-gcc.patch new file mode 100644 index 0000000000000000000000000000000000000000..e92defcb8dabe015c3fd2fbb34f5f1414bce44e3 --- /dev/null +++ b/backport-clang-0008-Suppress-Wmaybe-uninitialized-only-for-gcc.patch @@ -0,0 +1,457 @@ +From eefa33554e559d1ec3687e31463d4cba6dd45277 Mon Sep 17 00:00:00 2001 +From: Adhemerval Zanella +Date: Wed, 9 Mar 2022 15:51:50 -0300 +Subject: [PATCH] Suppress -Wmaybe-uninitialized only for gcc + +The warning is not supported by clang. +--- + hurd/hurdsig.c | 2 +- + inet/net-internal.h | 2 +- + malloc/malloc-check.c | 2 +- + nis/nis_table.c | 2 +- + nptl/tst-thread-setspecific.c | 2 +- + resolv/res_send.c | 10 +++++----- + stdio-common/vfscanf-internal.c | 2 +- + stdlib/bug-getcontext.c | 2 +- + string/wordcopy.c | 6 +++--- + sunrpc/clnt_udp.c | 2 +- + sysdeps/ieee754/dbl-64/e_lgamma_r.c | 2 +- + sysdeps/ieee754/dbl-64/k_rem_pio2.c | 2 +- + sysdeps/ieee754/flt-32/e_lgammaf_r.c | 2 +- + sysdeps/ieee754/ldbl-128/k_tanl.c | 2 +- + sysdeps/ieee754/ldbl-128ibm/k_tanl.c | 2 +- + sysdeps/ieee754/ldbl-96/e_lgammal_r.c | 2 +- + sysdeps/ieee754/ldbl-96/k_tanl.c | 2 +- + sysdeps/ieee754/soft-fp/s_ddivl.c | 2 +- + sysdeps/ieee754/soft-fp/s_dfmal.c | 2 +- + sysdeps/ieee754/soft-fp/s_dsqrtl.c | 2 +- + sysdeps/ieee754/soft-fp/s_fdiv.c | 2 +- + sysdeps/ieee754/soft-fp/s_fdivl.c | 2 +- + sysdeps/ieee754/soft-fp/s_ffma.c | 2 +- + sysdeps/ieee754/soft-fp/s_ffmal.c | 2 +- + sysdeps/ieee754/soft-fp/s_fma.c | 2 +- + sysdeps/ieee754/soft-fp/s_fmaf.c | 2 +- + sysdeps/ieee754/soft-fp/s_fmal.c | 2 +- + sysdeps/unix/sysv/linux/convert_scm_timestamps.c | 2 +- + 28 files changed, 34 insertions(+), 34 deletions(-) + +diff --git a/hurd/hurdsig.c b/hurd/hurdsig.c +index ce56d28520..d8cc6ac8ff 100644 +--- a/hurd/hurdsig.c ++++ b/hurd/hurdsig.c +@@ -376,7 +376,7 @@ interrupted_reply_port_location (thread_t thread, + /* GCC 6 and before seem to be confused by the setjmp call inside + _hurdsig_catch_memory_fault and think that we may be returning a second + time to here with portloc uninitialized (but we never do). */ +- DIAG_IGNORE_NEEDS_COMMENT (6, "-Wmaybe-uninitialized"); ++ DIAG_IGNORE_NEEDS_COMMENT_GCC (6, "-Wmaybe-uninitialized"); + /* Fault now if this pointer is bogus. */ + *(volatile mach_port_t *) portloc = *portloc; + DIAG_POP_NEEDS_COMMENT; +diff --git a/inet/net-internal.h b/inet/net-internal.h +index a5cf108bac..41e350b9aa 100644 +--- a/inet/net-internal.h ++++ b/inet/net-internal.h +@@ -106,7 +106,7 @@ __deadline_is_infinite (struct deadline deadline) + * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91691 + */ + DIAG_PUSH_NEEDS_COMMENT; +-DIAG_IGNORE_NEEDS_COMMENT (9, "-Wmaybe-uninitialized"); ++DIAG_IGNORE_NEEDS_COMMENT_GCC (9, "-Wmaybe-uninitialized"); + + /* Return true if the current time is at the deadline or past it. */ + static inline bool +diff --git a/malloc/malloc-check.c b/malloc/malloc-check.c +index 5732d81bf1..72cf3ee0f7 100644 +--- a/malloc/malloc-check.c ++++ b/malloc/malloc-check.c +@@ -319,7 +319,7 @@ realloc_check (void *oldmem, size_t bytes) + #if __GNUC_PREREQ (7, 0) + /* GCC 7 warns about magic_p may be used uninitialized. But we never + reach here if magic_p is uninitialized. */ +- DIAG_IGNORE_NEEDS_COMMENT (7, "-Wmaybe-uninitialized"); ++ DIAG_IGNORE_NEEDS_COMMENT_GCC (7, "-Wmaybe-uninitialized"); + #endif + /* mem2chunk_check changed the magic byte in the old chunk. + If newmem is NULL, then the old chunk will still be used though, +diff --git a/nis/nis_table.c b/nis/nis_table.c +index 16cc4befb8..04e7f2ef99 100644 +--- a/nis/nis_table.c ++++ b/nis/nis_table.c +@@ -180,7 +180,7 @@ __follow_path (char **tablepath, char **tableptr, struct ib_request *ibreq, + /* Since tableptr is only set here, and it's set when tablepath is NULL, + which it is initially defined as, we know it will always be set here. */ + DIAG_PUSH_NEEDS_COMMENT; +- DIAG_IGNORE_NEEDS_COMMENT (4.7, "-Wmaybe-uninitialized"); ++ DIAG_IGNORE_NEEDS_COMMENT_GCC (4.7, "-Wmaybe-uninitialized"); + + if (*tableptr == NULL) + return NIS_NOTFOUND; +diff --git a/nptl/tst-thread-setspecific.c b/nptl/tst-thread-setspecific.c +index c0e93381af..0b19cef06f 100644 +--- a/nptl/tst-thread-setspecific.c ++++ b/nptl/tst-thread-setspecific.c +@@ -25,7 +25,7 @@ + See BZ #27714. */ + + DIAG_PUSH_NEEDS_COMMENT; +-DIAG_IGNORE_NEEDS_COMMENT (6, "-Wmaybe-uninitialized"); ++DIAG_IGNORE_NEEDS_COMMENT_GCC (6, "-Wmaybe-uninitialized"); + DIAG_IGNORE_NEEDS_COMMENT (6, "-Wuninitialized"); + + static int +diff --git a/resolv/res_send.c b/resolv/res_send.c +index d098eba470..4053151a32 100644 +--- a/resolv/res_send.c ++++ b/resolv/res_send.c +@@ -266,7 +266,7 @@ __res_context_send (struct resolv_context *ctx, + Here the variable n is set to the return value of send_vc. + See below. */ + DIAG_PUSH_NEEDS_COMMENT; +- DIAG_IGNORE_NEEDS_COMMENT (9, "-Wmaybe-uninitialized"); ++ DIAG_IGNORE_NEEDS_COMMENT_GCC (9, "-Wmaybe-uninitialized"); + int n; + DIAG_POP_NEEDS_COMMENT; + +@@ -364,7 +364,7 @@ __res_context_send (struct resolv_context *ctx, + return (-1); + /* See comment at the declaration of n. */ + DIAG_PUSH_NEEDS_COMMENT; +- DIAG_IGNORE_NEEDS_COMMENT (9, "-Wmaybe-uninitialized"); ++ DIAG_IGNORE_NEEDS_COMMENT_GCC (9, "-Wmaybe-uninitialized"); + if (n == 0 && (buf2 == NULL || *resplen2 == 0)) + goto next_ns; + DIAG_POP_NEEDS_COMMENT; +@@ -388,7 +388,7 @@ __res_context_send (struct resolv_context *ctx, + + /* See comment at the declaration of n. Note: resplen = n; */ + DIAG_PUSH_NEEDS_COMMENT; +- DIAG_IGNORE_NEEDS_COMMENT (9, "-Wmaybe-uninitialized"); ++ DIAG_IGNORE_NEEDS_COMMENT_GCC (9, "-Wmaybe-uninitialized"); + /* Mask the AD bit in both responses unless it is + marked trusted. */ + if (resplen > HFIXEDSZ) +@@ -580,7 +580,7 @@ send_vc(res_state statp, + a false-positive. + */ + DIAG_PUSH_NEEDS_COMMENT; +- DIAG_IGNORE_NEEDS_COMMENT (5, "-Wmaybe-uninitialized"); ++ DIAG_IGNORE_NEEDS_COMMENT_GCC (5, "-Wmaybe-uninitialized"); + int resplen; + DIAG_POP_NEEDS_COMMENT; + struct iovec iov[4]; +@@ -852,7 +852,7 @@ reopen (res_state statp, int *terrno, int ns) + the function return -1 before control flow reaches + the call to connect with slen. */ + DIAG_PUSH_NEEDS_COMMENT; +- DIAG_IGNORE_Os_NEEDS_COMMENT (5, "-Wmaybe-uninitialized"); ++ DIAG_IGNORE_NEEDS_COMMENT_GCC (5, "-Wmaybe-uninitialized"); + if (__connect (EXT (statp).nssocks[ns], nsap, slen) < 0) { + DIAG_POP_NEEDS_COMMENT; + __res_iclose(statp, false); +diff --git a/stdio-common/vfscanf-internal.c b/stdio-common/vfscanf-internal.c +index 9b1197d751..eee9835a97 100644 +--- a/stdio-common/vfscanf-internal.c ++++ b/stdio-common/vfscanf-internal.c +@@ -1560,7 +1560,7 @@ __vfscanf_internal (FILE *s, const char *format, va_list argptr, + above, but the test for "map != NULL" is done + inside the loop here and outside the loop there. */ + DIAG_PUSH_NEEDS_COMMENT; +- DIAG_IGNORE_NEEDS_COMMENT (4.7, "-Wmaybe-uninitialized"); ++ DIAG_IGNORE_NEEDS_COMMENT_GCC (4.7, "-Wmaybe-uninitialized"); + + if (__glibc_unlikely (map != NULL)) + wcdigits[n] = digits_extended[n]; +diff --git a/stdlib/bug-getcontext.c b/stdlib/bug-getcontext.c +index 55c681c480..9e5e6c7e1c 100644 +--- a/stdlib/bug-getcontext.c ++++ b/stdlib/bug-getcontext.c +@@ -56,7 +56,7 @@ do_test (void) + in local variables being clobbered on the second return from + getcontext), in fact an uninitialized use is not possible. */ + DIAG_PUSH_NEEDS_COMMENT; +- DIAG_IGNORE_NEEDS_COMMENT (5, "-Wmaybe-uninitialized"); ++ DIAG_IGNORE_NEEDS_COMMENT_GCC (5, "-Wmaybe-uninitialized"); + int mask = fegetexcept (); + if (mask != except_mask) + { +diff --git a/string/wordcopy.c b/string/wordcopy.c +index a8a40c9f01..fe8220c476 100644 +--- a/string/wordcopy.c ++++ b/string/wordcopy.c +@@ -29,7 +29,7 @@ + Since the usage is within the MERGE macro we disable the + warning in the definition, but only in this file. */ + DIAG_PUSH_NEEDS_COMMENT; +-DIAG_IGNORE_NEEDS_COMMENT (6, "-Wmaybe-uninitialized"); ++DIAG_IGNORE_NEEDS_COMMENT_GCC (6, "-Wmaybe-uninitialized"); + #include + DIAG_POP_NEEDS_COMMENT; + +@@ -112,7 +112,7 @@ WORDCOPY_FWD_ALIGNED (long int dstp, long int srcp, size_t len) + case. The switch case always sets 'a1' and all previous loop + iterations will also have set 'a1' before the use. */ + DIAG_PUSH_NEEDS_COMMENT; +- DIAG_IGNORE_NEEDS_COMMENT (6, "-Wmaybe-uninitialized"); ++ DIAG_IGNORE_NEEDS_COMMENT_GCC (6, "-Wmaybe-uninitialized"); + ((op_t *) dstp)[0] = a1; + DIAG_POP_NEEDS_COMMENT; + do7: +@@ -313,7 +313,7 @@ WORDCOPY_BWD_ALIGNED (long int dstp, long int srcp, size_t len) + a0 = ((op_t *) srcp)[7]; + /* Check the comment on WORDCOPY_FWD_ALIGNED. */ + DIAG_PUSH_NEEDS_COMMENT; +- DIAG_IGNORE_NEEDS_COMMENT (6, "-Wmaybe-uninitialized"); ++ DIAG_IGNORE_NEEDS_COMMENT_GCC (6, "-Wmaybe-uninitialized"); + ((op_t *) dstp)[7] = a1; + DIAG_POP_NEEDS_COMMENT; + do7: +diff --git a/sunrpc/clnt_udp.c b/sunrpc/clnt_udp.c +index ee79b09b40..4353e5da18 100644 +--- a/sunrpc/clnt_udp.c ++++ b/sunrpc/clnt_udp.c +@@ -299,7 +299,7 @@ clntudp_call (/* client handle */ + inet/net-internal.h because in some other configurations GCC + gives the warning in an inline function. */ + DIAG_PUSH_NEEDS_COMMENT; +- DIAG_IGNORE_NEEDS_COMMENT (10, "-Wmaybe-uninitialized"); ++ DIAG_IGNORE_NEEDS_COMMENT_GCC (10, "-Wmaybe-uninitialized"); + struct deadline total_deadline; /* Determined once by overall timeout. */ + DIAG_POP_NEEDS_COMMENT; + struct deadline response_deadline; /* Determined anew for each query. */ +diff --git a/sysdeps/ieee754/dbl-64/e_lgamma_r.c b/sysdeps/ieee754/dbl-64/e_lgamma_r.c +index 72c68b6682..c298c8ca03 100644 +--- a/sysdeps/ieee754/dbl-64/e_lgamma_r.c ++++ b/sysdeps/ieee754/dbl-64/e_lgamma_r.c +@@ -304,7 +304,7 @@ __ieee754_lgamma_r(double x, int *signgamp) + although in the cases where it is used it has always been + set. */ + DIAG_PUSH_NEEDS_COMMENT; +- DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wmaybe-uninitialized"); ++ DIAG_IGNORE_NEEDS_COMMENT_GCC (4.9, "-Wmaybe-uninitialized"); + if(hx<0) r = nadj - r; + DIAG_POP_NEEDS_COMMENT; + return r; +diff --git a/sysdeps/ieee754/dbl-64/k_rem_pio2.c b/sysdeps/ieee754/dbl-64/k_rem_pio2.c +index 6e2ef5d07b..78d1ea09ad 100644 +--- a/sysdeps/ieee754/dbl-64/k_rem_pio2.c ++++ b/sysdeps/ieee754/dbl-64/k_rem_pio2.c +@@ -337,7 +337,7 @@ recompute: + to full precision (this function is not called for zero + arguments). */ + DIAG_PUSH_NEEDS_COMMENT; +- DIAG_IGNORE_NEEDS_COMMENT (9, "-Wmaybe-uninitialized"); ++ DIAG_IGNORE_NEEDS_COMMENT_GCC (9, "-Wmaybe-uninitialized"); + fv = math_narrow_eval (fq[0] - fv); + DIAG_POP_NEEDS_COMMENT; + for (i = 1; i <= jz; i++) +diff --git a/sysdeps/ieee754/flt-32/e_lgammaf_r.c b/sysdeps/ieee754/flt-32/e_lgammaf_r.c +index a1a3a60454..77dc54eaeb 100644 +--- a/sysdeps/ieee754/flt-32/e_lgammaf_r.c ++++ b/sysdeps/ieee754/flt-32/e_lgammaf_r.c +@@ -239,7 +239,7 @@ __ieee754_lgammaf_r(float x, int *signgamp) + although in the cases where it is used it has always been + set. */ + DIAG_PUSH_NEEDS_COMMENT; +- DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wmaybe-uninitialized"); ++ DIAG_IGNORE_NEEDS_COMMENT_GCC (4.9, "-Wmaybe-uninitialized"); + if(hx<0) r = nadj - r; + DIAG_POP_NEEDS_COMMENT; + return r; +diff --git a/sysdeps/ieee754/ldbl-128/k_tanl.c b/sysdeps/ieee754/ldbl-128/k_tanl.c +index 8e93626a89..af10fbc64b 100644 +--- a/sysdeps/ieee754/ldbl-128/k_tanl.c ++++ b/sysdeps/ieee754/ldbl-128/k_tanl.c +@@ -143,7 +143,7 @@ __kernel_tanl (_Float128 x, _Float128 y, int iy) + uninitialized although in the cases where it is used it has + always been set. */ + DIAG_PUSH_NEEDS_COMMENT; +- DIAG_IGNORE_NEEDS_COMMENT (5, "-Wmaybe-uninitialized"); ++ DIAG_IGNORE_NEEDS_COMMENT_GCC (5, "-Wmaybe-uninitialized"); + if (sign < 0) + w = -w; + DIAG_POP_NEEDS_COMMENT; +diff --git a/sysdeps/ieee754/ldbl-128ibm/k_tanl.c b/sysdeps/ieee754/ldbl-128ibm/k_tanl.c +index cd95e46089..7a42a18e55 100644 +--- a/sysdeps/ieee754/ldbl-128ibm/k_tanl.c ++++ b/sysdeps/ieee754/ldbl-128ibm/k_tanl.c +@@ -143,7 +143,7 @@ __kernel_tanl (long double x, long double y, int iy) + uninitialized although in the cases where it is used it has + always been set. */ + DIAG_PUSH_NEEDS_COMMENT; +- DIAG_IGNORE_NEEDS_COMMENT (5, "-Wmaybe-uninitialized"); ++ DIAG_IGNORE_NEEDS_COMMENT_GCC (5, "-Wmaybe-uninitialized"); + if (sign < 0) + w = -w; + DIAG_POP_NEEDS_COMMENT; +diff --git a/sysdeps/ieee754/ldbl-96/e_lgammal_r.c b/sysdeps/ieee754/ldbl-96/e_lgammal_r.c +index 148c21bb8d..d4fd7f5272 100644 +--- a/sysdeps/ieee754/ldbl-96/e_lgammal_r.c ++++ b/sysdeps/ieee754/ldbl-96/e_lgammal_r.c +@@ -431,7 +431,7 @@ __ieee754_lgammal_r (long double x, int *signgamp) + in warnings that it may be used uninitialized although in the + cases where it is used it has always been set. */ + DIAG_PUSH_NEEDS_COMMENT; +- DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wmaybe-uninitialized"); ++ DIAG_IGNORE_NEEDS_COMMENT_GCC (4.9, "-Wmaybe-uninitialized"); + if (se & 0x8000) + r = nadj - r; + DIAG_POP_NEEDS_COMMENT; +diff --git a/sysdeps/ieee754/ldbl-96/k_tanl.c b/sysdeps/ieee754/ldbl-96/k_tanl.c +index 43a5aa4423..462795574f 100644 +--- a/sysdeps/ieee754/ldbl-96/k_tanl.c ++++ b/sysdeps/ieee754/ldbl-96/k_tanl.c +@@ -140,7 +140,7 @@ __kernel_tanl (long double x, long double y, int iy) + uninitialized although in the cases where it is used it has + always been set. */ + DIAG_PUSH_NEEDS_COMMENT; +- DIAG_IGNORE_NEEDS_COMMENT (4.8, "-Wmaybe-uninitialized"); ++ DIAG_IGNORE_NEEDS_COMMENT_GCC (4.8, "-Wmaybe-uninitialized"); + if (sign < 0) + w = -w; + DIAG_POP_NEEDS_COMMENT; +diff --git a/sysdeps/ieee754/soft-fp/s_ddivl.c b/sysdeps/ieee754/soft-fp/s_ddivl.c +index e9f8685405..9e97d4a212 100644 +--- a/sysdeps/ieee754/soft-fp/s_ddivl.c ++++ b/sysdeps/ieee754/soft-fp/s_ddivl.c +@@ -37,7 +37,7 @@ + versions of GCC, it may be where R is defined using a macro or it + may be where the macro is defined. This happens only with -O1. */ + DIAG_PUSH_NEEDS_COMMENT; +-DIAG_IGNORE_NEEDS_COMMENT (8, "-Wmaybe-uninitialized"); ++DIAG_IGNORE_NEEDS_COMMENT_GCC (8, "-Wmaybe-uninitialized"); + #include + #include + #include +diff --git a/sysdeps/ieee754/soft-fp/s_dfmal.c b/sysdeps/ieee754/soft-fp/s_dfmal.c +index ab097393bc..e824007913 100644 +--- a/sysdeps/ieee754/soft-fp/s_dfmal.c ++++ b/sysdeps/ieee754/soft-fp/s_dfmal.c +@@ -37,7 +37,7 @@ + it may be where R is defined using a macro or it may be where the + macro is defined. */ + DIAG_PUSH_NEEDS_COMMENT; +-DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wmaybe-uninitialized"); ++DIAG_IGNORE_NEEDS_COMMENT_GCC (4.9, "-Wmaybe-uninitialized"); + + #include + #include +diff --git a/sysdeps/ieee754/soft-fp/s_dsqrtl.c b/sysdeps/ieee754/soft-fp/s_dsqrtl.c +index c5c503bc4d..7d8b00c799 100644 +--- a/sysdeps/ieee754/soft-fp/s_dsqrtl.c ++++ b/sysdeps/ieee754/soft-fp/s_dsqrtl.c +@@ -35,7 +35,7 @@ + does not see that they are set in all cases where they are used, + resulting in warnings that they may be used uninitialized. */ + DIAG_PUSH_NEEDS_COMMENT; +-DIAG_IGNORE_NEEDS_COMMENT (7, "-Wmaybe-uninitialized"); ++DIAG_IGNORE_NEEDS_COMMENT_GCC (7, "-Wmaybe-uninitialized"); + #include + #include + #include +diff --git a/sysdeps/ieee754/soft-fp/s_fdiv.c b/sysdeps/ieee754/soft-fp/s_fdiv.c +index df8cb67ccb..fa2e94f47e 100644 +--- a/sysdeps/ieee754/soft-fp/s_fdiv.c ++++ b/sysdeps/ieee754/soft-fp/s_fdiv.c +@@ -34,7 +34,7 @@ + versions of GCC, it may be where R is defined using a macro or it + may be where the macro is defined. This happens only with -O1. */ + DIAG_PUSH_NEEDS_COMMENT; +-DIAG_IGNORE_NEEDS_COMMENT (8, "-Wmaybe-uninitialized"); ++DIAG_IGNORE_NEEDS_COMMENT_GCC (8, "-Wmaybe-uninitialized"); + #include + #include + #include +diff --git a/sysdeps/ieee754/soft-fp/s_fdivl.c b/sysdeps/ieee754/soft-fp/s_fdivl.c +index 83a6ab8435..2c1196d209 100644 +--- a/sysdeps/ieee754/soft-fp/s_fdivl.c ++++ b/sysdeps/ieee754/soft-fp/s_fdivl.c +@@ -33,7 +33,7 @@ + versions of GCC, it may be where R is defined using a macro or it + may be where the macro is defined. This happens only with -O1. */ + DIAG_PUSH_NEEDS_COMMENT; +-DIAG_IGNORE_NEEDS_COMMENT (8, "-Wmaybe-uninitialized"); ++(8); + #include + #include + #include +diff --git a/sysdeps/ieee754/soft-fp/s_ffma.c b/sysdeps/ieee754/soft-fp/s_ffma.c +index 8cae5a0b81..f00e78950b 100644 +--- a/sysdeps/ieee754/soft-fp/s_ffma.c ++++ b/sysdeps/ieee754/soft-fp/s_ffma.c +@@ -35,7 +35,7 @@ + it may be where R is defined using a macro or it may be where the + macro is defined. */ + DIAG_PUSH_NEEDS_COMMENT; +-DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wmaybe-uninitialized"); ++DIAG_IGNORE_NEEDS_COMMENT_GCC (4.9, "-Wmaybe-uninitialized"); + + #include + #include +diff --git a/sysdeps/ieee754/soft-fp/s_ffmal.c b/sysdeps/ieee754/soft-fp/s_ffmal.c +index 0eddf80618..6de9a3128c 100644 +--- a/sysdeps/ieee754/soft-fp/s_ffmal.c ++++ b/sysdeps/ieee754/soft-fp/s_ffmal.c +@@ -33,7 +33,7 @@ + it may be where R is defined using a macro or it may be where the + macro is defined. */ + DIAG_PUSH_NEEDS_COMMENT; +-DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wmaybe-uninitialized"); ++DIAG_IGNORE_NEEDS_COMMENT_GCC (4.9, "-Wmaybe-uninitialized"); + + #include + #include +diff --git a/sysdeps/ieee754/soft-fp/s_fma.c b/sysdeps/ieee754/soft-fp/s_fma.c +index 91b29333da..2fb3dd5ade 100644 +--- a/sysdeps/ieee754/soft-fp/s_fma.c ++++ b/sysdeps/ieee754/soft-fp/s_fma.c +@@ -42,7 +42,7 @@ + it may be where R is defined using a macro or it may be where the + macro is defined. */ + DIAG_PUSH_NEEDS_COMMENT; +-DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wmaybe-uninitialized"); ++DIAG_IGNORE_NEEDS_COMMENT_GCC (4.9, "-Wmaybe-uninitialized"); + + #include "soft-fp.h" + #include "double.h" +diff --git a/sysdeps/ieee754/soft-fp/s_fmaf.c b/sysdeps/ieee754/soft-fp/s_fmaf.c +index f1c58b6bed..52c2f25e47 100644 +--- a/sysdeps/ieee754/soft-fp/s_fmaf.c ++++ b/sysdeps/ieee754/soft-fp/s_fmaf.c +@@ -37,7 +37,7 @@ + it may be where R is defined using a macro or it may be where the + macro is defined. */ + DIAG_PUSH_NEEDS_COMMENT; +-DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wmaybe-uninitialized"); ++DIAG_IGNORE_NEEDS_COMMENT_GCC (4.9, "-Wmaybe-uninitialized"); + + #include "soft-fp.h" + #include "single.h" +diff --git a/sysdeps/ieee754/soft-fp/s_fmal.c b/sysdeps/ieee754/soft-fp/s_fmal.c +index b5a8a06a53..3b8b31e736 100644 +--- a/sysdeps/ieee754/soft-fp/s_fmal.c ++++ b/sysdeps/ieee754/soft-fp/s_fmal.c +@@ -40,7 +40,7 @@ + it may be where R is defined using a macro or it may be where the + macro is defined. */ + DIAG_PUSH_NEEDS_COMMENT; +-DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wmaybe-uninitialized"); ++DIAG_IGNORE_NEEDS_COMMENT_GCC (4.9, "-Wmaybe-uninitialized"); + + #include "soft-fp.h" + #include "quad.h" +diff --git a/sysdeps/unix/sysv/linux/convert_scm_timestamps.c b/sysdeps/unix/sysv/linux/convert_scm_timestamps.c +index 06c8adeee1..fca3f7f766 100644 +--- a/sysdeps/unix/sysv/linux/convert_scm_timestamps.c ++++ b/sysdeps/unix/sysv/linux/convert_scm_timestamps.c +@@ -51,7 +51,7 @@ __convert_scm_timestamps (struct msghdr *msg, socklen_t msgsize) + (done by either COMPAT_SO_TIMESTAMP_OLD or COMPAT_SO_TIMESTAMPNS_OLD) + which will fallthrough to 'common' label. */ + DIAG_PUSH_NEEDS_COMMENT; +- DIAG_IGNORE_NEEDS_COMMENT (6, "-Wmaybe-uninitialized"); ++ DIAG_IGNORE_NEEDS_COMMENT_GCC (6, "-Wmaybe-uninitialized"); + int64_t tvts[2]; + DIAG_POP_NEEDS_COMMENT; + int32_t tmp[2]; +-- +2.39.3 diff --git a/backport-clang-0009-posix-Use-unsigned-to-check-for-_POSIX_VDISABLE.patch b/backport-clang-0009-posix-Use-unsigned-to-check-for-_POSIX_VDISABLE.patch new file mode 100644 index 0000000000000000000000000000000000000000..e40b40ecb5adfe34e634b0108eb33c77288cdf77 --- /dev/null +++ b/backport-clang-0009-posix-Use-unsigned-to-check-for-_POSIX_VDISABLE.patch @@ -0,0 +1,45 @@ +From fe98553c962205b5547b7b39f5c6c5d1031b436a Mon Sep 17 00:00:00 2001 +From: Adhemerval Zanella +Date: Tue, 15 Mar 2022 18:09:10 -0300 +Subject: [PATCH] posix: Use unsigned to check for _POSIX_VDISABLE + +Clang warns: + + ../sysdeps/posix/fpathconf.c:118:21: error: right side of operator + converted from negative value to unsigned: -1 to 18446744073709551615 + [-Werror] + #if _POSIX_VDISABLE == -1 + ~~~~~~~~~~~~~~~ ^ ~~ +--- + sysdeps/posix/fpathconf.c | 2 +- + sysdeps/posix/pathconf.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/sysdeps/posix/fpathconf.c b/sysdeps/posix/fpathconf.c +index ce432962cd..d5436e523a 100644 +--- a/sysdeps/posix/fpathconf.c ++++ b/sysdeps/posix/fpathconf.c +@@ -115,7 +115,7 @@ __fpathconf (int fd, int name) + return _POSIX_NO_TRUNC; + + case _PC_VDISABLE: +-#if _POSIX_VDISABLE == -1 ++#if _POSIX_VDISABLE == -1U + # error "Invalid value for _POSIX_VDISABLE" + #endif + return _POSIX_VDISABLE; +diff --git a/sysdeps/posix/pathconf.c b/sysdeps/posix/pathconf.c +index 2cf0ad5abf..8e15801dbf 100644 +--- a/sysdeps/posix/pathconf.c ++++ b/sysdeps/posix/pathconf.c +@@ -113,7 +113,7 @@ __pathconf (const char *path, int name) + return _POSIX_NO_TRUNC; + + case _PC_VDISABLE: +-#if _POSIX_VDISABLE == -1 ++#if _POSIX_VDISABLE == -1U + # error "Invalid value for _POSIX_VDISABLE" + #endif + return _POSIX_VDISABLE; +-- +2.39.3 diff --git a/backport-clang-0010-resolv-Handle-Wsometimes-uninitialized-on-getaddrinfo.patch b/backport-clang-0010-resolv-Handle-Wsometimes-uninitialized-on-getaddrinfo.patch new file mode 100644 index 0000000000000000000000000000000000000000..71dcc2504d79ebd662d98ef1190f0a6f28cf20f9 --- /dev/null +++ b/backport-clang-0010-resolv-Handle-Wsometimes-uninitialized-on-getaddrinfo.patch @@ -0,0 +1,54 @@ +From 05bacf0daf3292678d566df371ad331249fe23b3 Mon Sep 17 00:00:00 2001 +From: Adhemerval Zanella +Date: Tue, 22 Mar 2022 16:01:34 -0300 +Subject: [PATCH] resolv: Handle -Wsometimes-uninitialized on getaddrinfo + +--- + sysdeps/posix/getaddrinfo.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c +index 531124958d..fb913d7d6b 100644 +--- a/sysdeps/posix/getaddrinfo.c ++++ b/sysdeps/posix/getaddrinfo.c +@@ -1874,6 +1874,10 @@ add_prefixlist (struct prefixlist **listp, size_t *lenp, bool *nullbitsp, + if (cp != NULL) + *cp++ = '\0'; + *pos = cp; ++ /* clang warns that endp is used uninitialized whenever '||' condition ++ is true, however it will be evaluated after strtoul call. */ ++ DIAG_PUSH_NEEDS_COMMENT_CLANG; ++ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wsometimes-uninitialized"); + if (inet_pton (AF_INET6, val1, &prefix) + && (cp == NULL + || (bits = strtoul (cp, &endp, 10)) != ULONG_MAX +@@ -1897,6 +1901,7 @@ add_prefixlist (struct prefixlist **listp, size_t *lenp, bool *nullbitsp, + ++*lenp; + *nullbitsp |= bits == 0; + } ++ DIAG_POP_NEEDS_COMMENT_CLANG; + return true; + } + +@@ -2035,6 +2040,11 @@ gaiconf_init (void) + if (inet_pton (AF_INET6, val1, &prefix)) + { + bits = 128; ++ /* clang warns that endp is used uninitialized whenever '||' ++ condition is true, however it will be evaluated after ++ strtoul call. */ ++ DIAG_PUSH_NEEDS_COMMENT_CLANG; ++ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wsometimes-uninitialized"); + if (IN6_IS_ADDR_V4MAPPED (&prefix) + && (cp == NULL + || (bits = strtoul (cp, &endp, 10)) != ULONG_MAX +@@ -2056,6 +2066,7 @@ gaiconf_init (void) + goto no_file; + } + } ++ DIAG_POP_NEEDS_COMMENT_CLANG; + } + else if (inet_pton (AF_INET, val1, &prefix.s6_addr32[3]) + && (cp == NULL +-- +2.39.3 diff --git a/backport-clang-0011-misc-Suppress-clang-warnings-on-syslog.patch b/backport-clang-0011-misc-Suppress-clang-warnings-on-syslog.patch new file mode 100644 index 0000000000000000000000000000000000000000..25c42bb302c0d20f4864c7627da6a0e24a45c0d6 --- /dev/null +++ b/backport-clang-0011-misc-Suppress-clang-warnings-on-syslog.patch @@ -0,0 +1,78 @@ +From a0dd7c2e8c5c561d34f8ea58b9ad95e5f20329ee Mon Sep 17 00:00:00 2001 +From: luofeng +Date: Thu, 11 Apr 2024 21:37:06 +0800 +Subject: [PATCH] backport-clang-0011-misc-Suppress-clang-warnings-on-syslog + +--- + misc/syslog.c | 20 +++++++++++++++++--- + 1 file changed, 17 insertions(+), 3 deletions(-) + +diff --git a/misc/syslog.c b/misc/syslog.c +index 4af87f5..c92787e 100644 +--- a/misc/syslog.c ++++ b/misc/syslog.c +@@ -31,6 +31,7 @@ + static char sccsid[] = "@(#)syslog.c 8.4 (Berkeley) 3/18/94"; + #endif /* LIBC_SCCS and not lint */ + ++#include + #include + #include + #include +@@ -179,6 +180,10 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap, + #define SYSLOG_HEADER_WITHOUT_TS(__pri, __msgoff) \ + "<%d>: %n", __pri, __msgoff + ++ /* clang complains that adding a 'int_t' to a string does not append to it, ++ but the idea is to print the pid conditionally. */ ++ DIAG_PUSH_NEEDS_COMMENT_CLANG; ++ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int"); + int l, vl; + if (has_ts) + l = __snprintf (bufs, sizeof bufs, +@@ -186,6 +191,8 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap, + else + l = __snprintf (bufs, sizeof bufs, + SYSLOG_HEADER_WITHOUT_TS (pri, &msgoff)); ++ DIAG_POP_NEEDS_COMMENT_CLANG; ++ + if (l < 0) + goto out; + +@@ -238,6 +245,8 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap, + clarg.buf = buf; + + int cl; ++ DIAG_PUSH_NEEDS_COMMENT_CLANG; ++ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int"); + if (has_ts) + cl = __snprintf (buf, l + 1, + SYSLOG_HEADER (pri, timestamp, &msgoff, pid)); +@@ -252,7 +261,7 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap, + cl = __vsnprintf_internal (buf + l, bufsize - l + 1, fmt, apc, + mode_flags); + va_end (apc); +- ++ DIAG_POP_NEEDS_COMMENT_CLANG; + if (cl != vl) + goto out; + } +@@ -273,8 +282,13 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap, + + /* Output to stderr if requested. */ + if (LogStat & LOG_PERROR) +- __dprintf (STDERR_FILENO, "%s%s", buf + msgoff, +- "\n" + (buf[bufsize - 1] == '\n')); ++ { ++ DIAG_PUSH_NEEDS_COMMENT_CLANG; ++ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int"); ++ __dprintf (STDERR_FILENO, "%s%s", buf + msgoff, ++ "\n" + (buf[bufsize - 1] == '\n')); ++ DIAG_POP_NEEDS_COMMENT_CLANG; ++ } + + /* Get connected, output the message to the local logger. */ + if (!connected) +-- +2.19.1 + diff --git a/backport-clang-0012-argp-Expand-argp_usage-_option_is_short-and-_option_is_end.patch b/backport-clang-0012-argp-Expand-argp_usage-_option_is_short-and-_option_is_end.patch new file mode 100644 index 0000000000000000000000000000000000000000..01828fbc363623e16a782caa08ec0e6a28364295 --- /dev/null +++ b/backport-clang-0012-argp-Expand-argp_usage-_option_is_short-and-_option_is_end.patch @@ -0,0 +1,101 @@ +From bf7ac8d7a812c9f6be104aa48ae8f5744260e2db Mon Sep 17 00:00:00 2001 +From: Adhemerval Zanella +Date: Thu, 21 Jul 2022 14:12:01 -0300 +Subject: [PATCH] argp: Expand argp_usage, _option_is_short, and _option_is_end + +The argp code uses some clever macro redefine to avoid need to +duplicate the optimized static inline implementations for +argp_usage, _option_is_short, and _option_is_end. This however +leads to some build issues with clang, since some function +prototypes are redefined to add the hidden attribute with +libc_hidden_proto. + +To avoid extensive changes on internal headers, just expand the +function implementations and avoid the macro redefine tricks. +--- + argp/argp-xinl.c | 34 +++++++++++++++++++++++----------- + argp/argp.h | 10 +++------- + 2 files changed, 26 insertions(+), 18 deletions(-) + +diff --git a/argp/argp-xinl.c b/argp/argp-xinl.c +index b7cd70cc51..ae41d3bdb4 100644 +--- a/argp/argp-xinl.c ++++ b/argp/argp-xinl.c +@@ -25,19 +25,31 @@ + # include + #endif + +-#ifndef __USE_EXTERN_INLINES +-# define __USE_EXTERN_INLINES 1 +-#endif +-#define ARGP_EI +-#undef __OPTIMIZE__ +-#define __OPTIMIZE__ 1 + #include + +-/* Add weak aliases. */ +-#if _LIBC - 0 && defined (weak_alias) +- ++void ++__argp_usage (const struct argp_state *__state) ++{ ++ __argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE); ++} + weak_alias (__argp_usage, argp_usage) ++ ++int ++__option_is_short (const struct argp_option *__opt) ++{ ++ if (__opt->flags & OPTION_DOC) ++ return 0; ++ else ++ { ++ int __key = __opt->key; ++ return __key > 0 && __key <= UCHAR_MAX && isprint (__key); ++ } ++} + weak_alias (__option_is_short, _option_is_short) +-weak_alias (__option_is_end, _option_is_end) + +-#endif ++int ++__option_is_end (const struct argp_option *__opt) ++{ ++ return !__opt->key && !__opt->name && !__opt->doc && !__opt->group; ++} ++weak_alias (__option_is_end, _option_is_end) +diff --git a/argp/argp.h b/argp/argp.h +index 77d696c65d..b899a53bd8 100644 +--- a/argp/argp.h ++++ b/argp/argp.h +@@ -518,17 +518,13 @@ extern void *__argp_input (const struct argp *__restrict __argp, + # define __option_is_end _option_is_end + # endif + +-# ifndef ARGP_EI +-# define ARGP_EI __extern_inline +-# endif +- +-ARGP_EI void ++__extern_inline void + __argp_usage (const struct argp_state *__state) + { + __argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE); + } + +-ARGP_EI int ++__extern_inline int + __NTH (__option_is_short (const struct argp_option *__opt)) + { + if (__opt->flags & OPTION_DOC) +@@ -540,7 +536,7 @@ __NTH (__option_is_short (const struct argp_option *__opt)) + } + } + +-ARGP_EI int ++__extern_inline int + __NTH (__option_is_end (const struct argp_option *__opt)) + { + return !__opt->key && !__opt->name && !__opt->doc && !__opt->group; +-- +2.39.3 diff --git a/backport-clang-0013-nss-Suppress-nss_module.c-warning-on-clang.patch b/backport-clang-0013-nss-Suppress-nss_module.c-warning-on-clang.patch new file mode 100644 index 0000000000000000000000000000000000000000..0061ac7b375e292c063c9dbfa74eeea48578615d --- /dev/null +++ b/backport-clang-0013-nss-Suppress-nss_module.c-warning-on-clang.patch @@ -0,0 +1,41 @@ +From 8f7dcf1d25101403e1fe83c8b5c882ee4287843b Mon Sep 17 00:00:00 2001 +From: Adhemerval Zanella +Date: Thu, 10 Mar 2022 08:31:06 -0300 +Subject: [PATCH] nss: Suppress nss_module.c warning on clang + +clang issues an warning adding 'unsigned long' to a string does not +append to the string, however it is exactly what code means here. +--- + nss/nss_module.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/nss/nss_module.c b/nss/nss_module.c +index 0104f88974..ee99598e70 100644 +--- a/nss/nss_module.c ++++ b/nss/nss_module.c +@@ -33,6 +33,8 @@ + #include + #include + #include ++#include ++#include + + /* Suffix after .so of NSS service modules. This is a bit of magic, + but we assume LIBNSS_FILES_SO looks like "libnss_files.so.2" and we +@@ -40,8 +42,14 @@ + except through the auto-generated lib-names.h and some static + pointer manipulation. The "-1" accounts for the trailing NUL + included in the sizeof. */ ++ ++/* clang issues an warning adding 'unsigned long' to a string does not append ++ to the string, however it is exactly what code means here. */ ++DIAG_PUSH_NEEDS_COMMENT_CLANG; ++DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int"); + static const char *const __nss_shlib_revision + = LIBNSS_FILES_SO + sizeof("libnss_files.so") - 1; ++DIAG_POP_NEEDS_COMMENT_CLANG; + + /* A single-linked list used to implement a mapping from service names + to NSS modules. (Most systems only use five or so modules, so a +-- +2.39.3 diff --git a/backport-clang-0014-sunrpc-Remove-extra-parenthesis-on-comparison.patch b/backport-clang-0014-sunrpc-Remove-extra-parenthesis-on-comparison.patch new file mode 100644 index 0000000000000000000000000000000000000000..e20c97668253b58138156a3e1a99be250382eb43 --- /dev/null +++ b/backport-clang-0014-sunrpc-Remove-extra-parenthesis-on-comparison.patch @@ -0,0 +1,27 @@ +From 87db8df7028b379970acc68cddd4f578adae166a Mon Sep 17 00:00:00 2001 +From: Adhemerval Zanella +Date: Thu, 10 Mar 2022 08:34:01 -0300 +Subject: [PATCH] sunrpc: Remove extra parenthesis on comparison + +clang issues a 'equality comparison with extraneous parentheses +[-Werror,-Wparentheses-equality]' in this. Instead of suppress +the warning, just follow the next comparison style. +--- + sunrpc/key_call.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sunrpc/key_call.c b/sunrpc/key_call.c +index b0b29e09a7..1072c97015 100644 +--- a/sunrpc/key_call.c ++++ b/sunrpc/key_call.c +@@ -456,7 +456,7 @@ getkeyserv_handle (int vers) + return kcp->client; + } + +- if ((kcp->client == (CLIENT *) NULL)) ++ if (kcp->client == (CLIENT *) NULL) + /* Use the AF_UNIX transport */ + kcp->client = clnt_create ("/var/run/keyservsock", KEY_PROG, vers, "unix"); + +-- +2.39.3 diff --git a/backport-clang-0015-sunrpc-Suppress-clang-warning-on-struct-cmessage.patch b/backport-clang-0015-sunrpc-Suppress-clang-warning-on-struct-cmessage.patch new file mode 100644 index 0000000000000000000000000000000000000000..b70d8244bb522e2046818bff760d051fdd9a00bf --- /dev/null +++ b/backport-clang-0015-sunrpc-Suppress-clang-warning-on-struct-cmessage.patch @@ -0,0 +1,46 @@ +From bf8a8e23506d26b79d03b4e23661e2a5a37d6990 Mon Sep 17 00:00:00 2001 +From: Adhemerval Zanella +Date: Thu, 10 Mar 2022 14:08:06 -0300 +Subject: [PATCH] sunrpc: Suppress clang warning on struct cmessage + +clang complains if a flexible array member (struct cmsghdr) is not a +the end of the struct (since it is a GNU extension). The __msgread +explicit expects that 'struct ucred' is after the 'cmsg', so suppress +the warning. +--- + sunrpc/svc_unix.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/sunrpc/svc_unix.c b/sunrpc/svc_unix.c +index be247f748c..9426850e4b 100644 +--- a/sunrpc/svc_unix.c ++++ b/sunrpc/svc_unix.c +@@ -65,6 +65,7 @@ + #include + #include + #include ++#include + + /* + * Ops vector for AF_UNIX based rpc service handle +@@ -308,12 +309,18 @@ svcunix_destroy (SVCXPRT *xprt) + } + + #ifdef SCM_CREDENTIALS ++/* clang complains if a flexible array member (struct cmsghdr) is not a the ++ end of the struct (since it is a GNU extension). The __msgread explicit ++ expects that 'struct ucred' is after the 'cmsg', so disable the warning. */ ++DIAG_PUSH_NEEDS_COMMENT_CLANG; ++DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wgnu-variable-sized-type-not-at-end"); + struct cmessage { + struct cmsghdr cmsg; + struct ucred cmcred; + /* hack to make sure we have enough memory */ + char dummy[(CMSG_ALIGN (sizeof (struct ucred)) - sizeof (struct ucred) + sizeof (long))]; + }; ++DIAG_POP_NEEDS_COMMENT_CLANG; + + /* XXX This is not thread safe, but since the main functions in svc.c + and the rpcgen generated *_svc functions for the daemon are also not +-- +2.39.3 diff --git a/backport-clang-0016-elf-Supress-clang-Wsometimes-uninitialized-on.patch b/backport-clang-0016-elf-Supress-clang-Wsometimes-uninitialized-on.patch new file mode 100644 index 0000000000000000000000000000000000000000..d5223099b993857555b07eb9bc7b9ed77106d5c2 --- /dev/null +++ b/backport-clang-0016-elf-Supress-clang-Wsometimes-uninitialized-on.patch @@ -0,0 +1,54 @@ +From 6248c3674e9acbc33afed2a65d4916cbb9873a77 Mon Sep 17 00:00:00 2001 +From: Adhemerval Zanella +Date: Wed, 24 Aug 2022 12:25:05 -0300 +Subject: [PATCH] elf: Supress clang -Wsometimes-uninitialized on + _dl_debug_initialize + +clang issues an warning where variable 'r' is used uninitialized +whenever 'if' condition is false. The _dl_debug_initialize is called +for static case always with LM_ID_BASE (csu/libc-start.c and +elf/dl-reloc-static-pie.c) and DL_NSS will be always larger than 1 +for shared case. +--- + elf/dl-debug.c | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +diff --git a/elf/dl-debug.c b/elf/dl-debug.c +index bd7b1cc8f7..3c4476c22c 100644 +--- a/elf/dl-debug.c ++++ b/elf/dl-debug.c +@@ -17,6 +17,7 @@ + . */ + + #include ++#include + + + /* These are the members in the public `struct link_map' type. +@@ -54,7 +55,15 @@ _dl_debug_update (Lmid_t ns) + struct r_debug * + _dl_debug_initialize (ElfW(Addr) ldbase, Lmid_t ns) + { +- struct r_debug_extended *r, **pp = NULL; ++ /* clang issues an warning where variable 'r' is used uninitialized whenever ++ 'if' condition is false. The _dl_debug_initialize is called for static ++ case always with LM_ID_BASE (csu/libc-start.c and ++ elf/dl-reloc-static-pie.c) and DL_NSS will be always larger than 1 for ++ shared case. */ ++ DIAG_PUSH_NEEDS_COMMENT_CLANG; ++ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wsometimes-uninitialized"); ++ struct r_debug_extended *r; ++ struct r_debug_extended **pp = NULL; + + if (ns == LM_ID_BASE) + { +@@ -81,6 +90,7 @@ _dl_debug_initialize (ElfW(Addr) ldbase, Lmid_t ns) + r->base.r_version = 2; + } + } ++ DIAG_POP_NEEDS_COMMENT_CLANG; + + if (r->base.r_brk == 0) + { +-- +2.39.3 diff --git a/backport-clang-0017-configure-Fix-check-for-fno-tree-loop-distribute-patterns.patch b/backport-clang-0017-configure-Fix-check-for-fno-tree-loop-distribute-patterns.patch new file mode 100644 index 0000000000000000000000000000000000000000..090972a4f07620d634d3e090b5ae82eaa3835ed4 --- /dev/null +++ b/backport-clang-0017-configure-Fix-check-for-fno-tree-loop-distribute-patterns.patch @@ -0,0 +1,42 @@ +From ffcaa3c6710fbaec084b8c66e3f480ef50aaf311 Mon Sep 17 00:00:00 2001 +From: Fangrui Song +Date: Sun, 26 Sep 2021 00:15:23 -0700 +Subject: [PATCH] configure: Fix check for -fno-tree-loop-distribute-patterns + +clang does not support -fno-tree-loop-distribute-patterns and using +on __attribute__ ((__optimize__ (...))) only triggers a warning +with AC_TRY_COMMAND. Add -Werror so the tests fails if compiler +does not support it. +--- + configure | 2 +- + configure.ac | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/configure b/configure +index 45ee893d49..85226db392 100755 +--- a/configure ++++ b/configure +@@ -7402,7 +7402,7 @@ __attribute__ ((__optimize__ ("-fno-tree-loop-distribute-patterns"))) + foo (void) {} + EOF + libc_cv_cc_loop_to_function=no +-if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -c conftest.c' ++if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c -fno-tree-loop-distribute-patterns' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 + (eval $ac_try) 2>&5 + ac_status=$? +diff --git a/configure.ac b/configure.ac +index 7a7fe4a28a..f508411c25 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1504,7 +1504,7 @@ __attribute__ ((__optimize__ ("-fno-tree-loop-distribute-patterns"))) + foo (void) {} + EOF + libc_cv_cc_loop_to_function=no +-if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -c conftest.c]) ++if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c -fno-tree-loop-distribute-patterns]) + then + libc_cv_cc_loop_to_function=yes + fi +-- +2.39.3 diff --git a/backport-clang-0018-elf-Suppress-clang-Wstring-plus-int-on-rtld-c.patch b/backport-clang-0018-elf-Suppress-clang-Wstring-plus-int-on-rtld-c.patch new file mode 100644 index 0000000000000000000000000000000000000000..672fce89daef4c4e6570bad63375020df97ec0f6 --- /dev/null +++ b/backport-clang-0018-elf-Suppress-clang-Wstring-plus-int-on-rtld-c.patch @@ -0,0 +1,35 @@ +From 8b6f258c17196139d3435cc09dca7a24b8706541 Mon Sep 17 00:00:00 2001 +From: Adhemerval Zanella +Date: Thu, 10 Mar 2022 09:48:32 -0300 +Subject: [PATCH] elf: Suppress clang -Wstring-plus-int on rtld.c + +clang issues an warning adding 'const unsigned char' to a string +does not append to the string, however it is exactly what code +means here. +--- + elf/rtld.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/elf/rtld.c b/elf/rtld.c +index 5107d16fe3..422a2bd021 100644 +--- a/elf/rtld.c ++++ b/elf/rtld.c +@@ -2515,10 +2515,16 @@ warning: debug option `%s' unknown; try LD_DEBUG=help\n", copy); + _dl_printf ("\ + Valid options for the LD_DEBUG environment variable are:\n\n"); + ++ /* clang issues an warning adding 'const unsigned char' to a string ++ does not append to the string, however it is exactly what code ++ means here. */ ++ DIAG_PUSH_NEEDS_COMMENT_CLANG; ++ DIAG_IGNORE_NEEDS_COMMENT_CLANG (16, "-Wstring-plus-int"); + for (cnt = 0; cnt < ndebopts; ++cnt) + _dl_printf (" %.*s%s%s\n", debopts[cnt].len, debopts[cnt].name, + " " + debopts[cnt].len - 3, + debopts[cnt].helptext); ++ DIAG_POP_NEEDS_COMMENT_CLANG; + + _dl_printf ("\n\ + To direct the debugging output into a file instead of standard output\n\ +-- +2.39.3 diff --git a/backport-clang-0019-Remove-include-h-install-rule.patch b/backport-clang-0019-Remove-include-h-install-rule.patch new file mode 100644 index 0000000000000000000000000000000000000000..bdab27f7932f881c15c24e3ecb8e8370e4eca850 --- /dev/null +++ b/backport-clang-0019-Remove-include-h-install-rule.patch @@ -0,0 +1,33 @@ +From ab5f12e0327c2a9349e4b92dfa7f7b983b64fe92 Mon Sep 17 00:00:00 2001 +From: Adhemerval Zanella +Date: Wed, 23 Mar 2022 16:22:41 -0300 +Subject: [PATCH] Remove include/*.h install rule + +clang limits.h depends on system limits.h, which makes the install +rule to try remove the system file: + + make[2]: Entering directory + '/home/azanella/Projects/glibc/glibc-git/iconv' + /usr/bin/install -c -m 644 ../include/limits.h /usr/include/limits.h + /usr/bin/install: cannot remove '/usr/include/limits.h': Permission denied + +The rule is not really used, so remove it. +--- + Makerules | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/Makerules b/Makerules +index 018780c818..be692d4fcb 100644 +--- a/Makerules ++++ b/Makerules +@@ -1122,8 +1122,6 @@ $(inst_includedir)/%.h: $(common-objpfx)%.h $(+force) + $(do-install) + $(inst_includedir)/%.h: %.h $(+force) + $(do-install) +-$(inst_includedir)/%.h: $(..)include/%.h $(+force) +- $(do-install) + headers-nonh := $(filter-out %.h,$(headers)) + ifdef headers-nonh + $(addprefix $(inst_includedir)/,$(headers-nonh)): $(inst_includedir)/%: \ +-- +2.39.3 diff --git a/backport-clang-0020-locale-Fix-implicit-conversion-on-collate_finish.patch b/backport-clang-0020-locale-Fix-implicit-conversion-on-collate_finish.patch new file mode 100644 index 0000000000000000000000000000000000000000..7f9c015a67bffbd8fa1544343ee63de948fcbde8 --- /dev/null +++ b/backport-clang-0020-locale-Fix-implicit-conversion-on-collate_finish.patch @@ -0,0 +1,31 @@ +From 9db1a9e5f0ed66fe8cc63807f51a966915460da2 Mon Sep 17 00:00:00 2001 +From: Adhemerval Zanella +Date: Thu, 10 Mar 2022 09:54:02 -0300 +Subject: [PATCH] locale: Fix implicit conversion on collate_finish + +Clang issues: + +programs/ld-collate.c:1824:55: error: implicit conversion from 'unsigned +long' to 'unsigned int' changes value from 18446744073709551615 to +4294967295 [-Werror,-Wconstant-conversion] + collate->undefined.used_in_level = need_undefined ? ~0ul : 0; + ~ ^~~~ +--- + locale/programs/ld-collate.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/locale/programs/ld-collate.c b/locale/programs/ld-collate.c +index 2c9f540bf1..e47baaa3ab 100644 +--- a/locale/programs/ld-collate.c ++++ b/locale/programs/ld-collate.c +@@ -1821,7 +1821,7 @@ symbol `%s' has the same encoding as"), (*eptr)->name); + + /* Now determine whether the UNDEFINED entry is needed and if yes, + whether it was defined. */ +- collate->undefined.used_in_level = need_undefined ? ~0ul : 0; ++ collate->undefined.used_in_level = need_undefined ? ~0u : 0; + if (collate->undefined.file == NULL) + { + if (need_undefined) +-- +2.39.3 diff --git a/backport-clang-0021-iconvdata-Suppress-clang-warning-on-locale-definitions.patch b/backport-clang-0021-iconvdata-Suppress-clang-warning-on-locale-definitions.patch new file mode 100644 index 0000000000000000000000000000000000000000..4808e2f2652b8942ddb44df3264c6f7029b9da83 --- /dev/null +++ b/backport-clang-0021-iconvdata-Suppress-clang-warning-on-locale-definitions.patch @@ -0,0 +1,84 @@ +From 575226c3b7e5ca26792e17bcead912ba181bc65c Mon Sep 17 00:00:00 2001 +From: Adhemerval Zanella +Date: Thu, 10 Mar 2022 10:01:09 -0300 +Subject: [PATCH] iconvdata: Suppress clang warning on locale definitions + +clang issues an warning adding '{unsigned} int' to a string does not +append to the string, however it is exactly what code means here. +--- + iconvdata/gbk.c | 5 +++++ + iconvdata/iso-2022-cn-ext.c | 5 +++++ + iconvdata/iso-2022-cn.c | 5 +++++ + 3 files changed, 15 insertions(+) + +diff --git a/iconvdata/gbk.c b/iconvdata/gbk.c +index 6a0ba3388a..40d582f5fb 100644 +--- a/iconvdata/gbk.c ++++ b/iconvdata/gbk.c +@@ -13212,6 +13212,10 @@ static const char __gbk_from_ucs4_tab12[][2] = + } + #include + ++/* clang issues an warning adding 'unsigned int' to a string does not append ++ to the string, however it is exactly what code means here. */ ++DIAG_PUSH_NEEDS_COMMENT_CLANG; ++DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int"); + + /* Next, define the other direction. */ + #define MIN_NEEDED_INPUT MIN_NEEDED_TO +@@ -13493,6 +13497,7 @@ static const char __gbk_from_ucs4_tab12[][2] = + #define LOOP_NEED_FLAGS + #include + ++DIAG_POP_NEEDS_COMMENT_CLANG; + + /* Now define the toplevel functions. */ + #include +diff --git a/iconvdata/iso-2022-cn-ext.c b/iconvdata/iso-2022-cn-ext.c +index 36727f0865..ef1be0bc28 100644 +--- a/iconvdata/iso-2022-cn-ext.c ++++ b/iconvdata/iso-2022-cn-ext.c +@@ -387,6 +387,10 @@ enum + #define LOOP_NEED_FLAGS + #include + ++/* clang issues an warning adding 'int' to a string does not append ++ to the string, however it is exactly what code means here. */ ++DIAG_PUSH_NEEDS_COMMENT_CLANG; ++DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int"); + + /* Next, define the other direction. */ + #define MIN_NEEDED_INPUT TO_LOOP_MIN_NEEDED_FROM +@@ -669,6 +673,7 @@ DIAG_POP_NEEDS_COMMENT; + #define LOOP_NEED_FLAGS + #include + ++DIAG_POP_NEEDS_COMMENT_CLANG; + + /* Now define the toplevel functions. */ + #include +diff --git a/iconvdata/iso-2022-cn.c b/iconvdata/iso-2022-cn.c +index 5660ead668..0973fdcc46 100644 +--- a/iconvdata/iso-2022-cn.c ++++ b/iconvdata/iso-2022-cn.c +@@ -227,6 +227,10 @@ enum + #define UPDATE_PARAMS *setp = set | ann + #include + ++/* clang issues an warning adding 'int' to a string does not append ++ to the string, however it is exactly what code means here. */ ++DIAG_PUSH_NEEDS_COMMENT_CLANG; ++DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int"); + + /* Next, define the other direction. */ + #define MIN_NEEDED_INPUT TO_LOOP_MIN_NEEDED_FROM +@@ -401,6 +405,7 @@ enum + #define UPDATE_PARAMS *setp = set | ann + #include + ++DIAG_POP_NEEDS_COMMENT_CLANG; + + /* Now define the toplevel functions. */ + #include +-- +2.39.3 diff --git a/backport-clang-0022-iconvdata-Remove-use-of-GNU-old-style-field-designator.patch b/backport-clang-0022-iconvdata-Remove-use-of-GNU-old-style-field-designator.patch new file mode 100644 index 0000000000000000000000000000000000000000..0376c9adca4c1012ce1ff334a4b3f4f6a8f98eea --- /dev/null +++ b/backport-clang-0022-iconvdata-Remove-use-of-GNU-old-style-field-designator.patch @@ -0,0 +1,1240 @@ +From 64020eace962d14f5e5854550005481c9d520b4d Mon Sep 17 00:00:00 2001 +From: Adhemerval Zanella +Date: Thu, 10 Mar 2022 10:24:53 -0300 +Subject: [PATCH] iconvdata: Remove use of GNU old-style field designator + extension + +Use the C99 syntax instead. +--- + iconvdata/ibm1008.h | 20 +++++++------- + iconvdata/ibm1025.h | 10 +++---- + iconvdata/ibm1097.h | 32 ++++++++++----------- + iconvdata/ibm1112.h | 22 +++++++-------- + iconvdata/ibm1122.h | 10 +++---- + iconvdata/ibm1123.h | 12 ++++---- + iconvdata/ibm1130.h | 20 +++++++------- + iconvdata/ibm1137.h | 10 +++---- + iconvdata/ibm1140.h | 8 +++--- + iconvdata/ibm1141.h | 8 +++--- + iconvdata/ibm1142.h | 8 +++--- + iconvdata/ibm1143.h | 8 +++--- + iconvdata/ibm1144.h | 8 +++--- + iconvdata/ibm1145.h | 8 +++--- + iconvdata/ibm1146.h | 8 +++--- + iconvdata/ibm1147.h | 8 +++--- + iconvdata/ibm1148.h | 8 +++--- + iconvdata/ibm1149.h | 8 +++--- + iconvdata/ibm1153.h | 24 ++++++++-------- + iconvdata/ibm1154.h | 12 ++++---- + iconvdata/ibm1155.h | 12 ++++---- + iconvdata/ibm1156.h | 24 ++++++++-------- + iconvdata/ibm1157.h | 12 ++++---- + iconvdata/ibm1158.h | 14 +++++----- + iconvdata/ibm1166.h | 26 ++++++++--------- + iconvdata/ibm1167.h | 44 ++++++++++++++--------------- + iconvdata/ibm12712.h | 22 +++++++-------- + iconvdata/ibm16804.h | 22 +++++++-------- + iconvdata/ibm4517.h | 24 ++++++++-------- + iconvdata/ibm4899.h | 16 +++++------ + iconvdata/ibm4909.h | 12 ++++---- + iconvdata/ibm4971.h | 12 ++++---- + iconvdata/ibm5347.h | 24 ++++++++-------- + iconvdata/ibm803.h | 10 +++---- + iconvdata/ibm901.h | 66 ++++++++++++++++++++++---------------------- + iconvdata/ibm902.h | 58 +++++++++++++++++++------------------- + iconvdata/ibm9030.h | 6 ++-- + iconvdata/ibm9066.h | 8 +++--- + iconvdata/ibm921.h | 22 +++++++-------- + iconvdata/ibm9448.h | 62 ++++++++++++++++++++--------------------- + 40 files changed, 374 insertions(+), 374 deletions(-) + +diff --git a/iconvdata/ibm1008.h b/iconvdata/ibm1008.h +index 2c2bd1161d..e7cc4e0a4c 100644 +--- a/iconvdata/ibm1008.h ++++ b/iconvdata/ibm1008.h +@@ -88,16 +88,16 @@ static const uint32_t to_ucs4[256] = + + static const struct gap from_idx[] = + { +- { start: 0x0000, end: 0x00ad, idx: 0 }, +- { start: 0x00d7, end: 0x00d7, idx: -41 }, +- { start: 0x00f7, end: 0x00f7, idx: -72 }, +- { start: 0x060c, end: 0x060c, idx: -1372 }, +- { start: 0x061b, end: 0x064a, idx: -1386 }, +- { start: 0x0651, end: 0x0651, idx: -1392 }, +- { start: 0x0660, end: 0x066d, idx: -1406 }, +- { start: 0xf8f4, end: 0xf8fc, idx: -63492 }, +- { start: 0xfe7c, end: 0xfefc, idx: -64899 }, +- { start: 0xffff, end: 0xffff, idx: 0 } ++ { .start = 0x0000, .end = 0x00ad, .idx = 0 }, ++ { .start = 0x00d7, .end = 0x00d7, .idx = -41 }, ++ { .start = 0x00f7, .end = 0x00f7, .idx = -72 }, ++ { .start = 0x060c, .end = 0x060c, .idx = -1372 }, ++ { .start = 0x061b, .end = 0x064a, .idx = -1386 }, ++ { .start = 0x0651, .end = 0x0651, .idx = -1392 }, ++ { .start = 0x0660, .end = 0x066d, .idx = -1406 }, ++ { .start = 0xf8f4, .end = 0xf8fc, .idx = -63492 }, ++ { .start = 0xfe7c, .end = 0xfefc, .idx = -64899 }, ++ { .start = 0xffff, .end = 0xffff, .idx = 0 } + }; + + static const char from_ucs4[] = +diff --git a/iconvdata/ibm1025.h b/iconvdata/ibm1025.h +index f7164262bb..993343717a 100644 +--- a/iconvdata/ibm1025.h ++++ b/iconvdata/ibm1025.h +@@ -88,11 +88,11 @@ static const uint32_t to_ucs4[256] = + + static const struct gap from_idx[] = + { +- { start: 0x0000, end: 0x00a0, idx: 0 }, +- { start: 0x00a7, end: 0x00ad, idx: -6 }, +- { start: 0x0401, end: 0x045f, idx: -857 }, +- { start: 0x2116, end: 0x2116, idx: -8207 }, +- { start: 0xffff, end: 0xffff, idx: 0 } ++ { .start = 0x0000, .end = 0x00a0, .idx = 0 }, ++ { .start = 0x00a7, .end = 0x00ad, .idx = -6 }, ++ { .start = 0x0401, .end = 0x045f, .idx = -857 }, ++ { .start = 0x2116, .end = 0x2116, .idx = -8207 }, ++ { .start = 0xffff, .end = 0xffff, .idx = 0 } + }; + + static const char from_ucs4[] = +diff --git a/iconvdata/ibm1097.h b/iconvdata/ibm1097.h +index 9a7e808f4b..f9197a776b 100644 +--- a/iconvdata/ibm1097.h ++++ b/iconvdata/ibm1097.h +@@ -88,22 +88,22 @@ static const uint32_t to_ucs4[256] = + + static const struct gap from_idx[] = + { +- { start: 0x0000, end: 0x00a4, idx: 0 }, +- { start: 0x00ab, end: 0x00ad, idx: -6 }, +- { start: 0x00bb, end: 0x00bb, idx: -19 }, +- { start: 0x00d7, end: 0x00d7, idx: -46 }, +- { start: 0x060c, end: 0x060c, idx: -1378 }, +- { start: 0x061b, end: 0x064b, idx: -1392 }, +- { start: 0x0660, end: 0x066d, idx: -1412 }, +- { start: 0x06f0, end: 0x06f9, idx: -1542 }, +- { start: 0xf8f9, end: 0xf8fb, idx: -63493 }, +- { start: 0xfb56, end: 0xfb58, idx: -64095 }, +- { start: 0xfb7a, end: 0xfb7c, idx: -64128 }, +- { start: 0xfb8a, end: 0xfb94, idx: -64141 }, +- { start: 0xfba4, end: 0xfba4, idx: -64156 }, +- { start: 0xfbfc, end: 0xfbfe, idx: -64243 }, +- { start: 0xfe80, end: 0xfeee, idx: -64884 }, +- { start: 0xffff, end: 0xffff, idx: 0 } ++ { .start = 0x0000, .end = 0x00a4, .idx = 0 }, ++ { .start = 0x00ab, .end = 0x00ad, .idx = -6 }, ++ { .start = 0x00bb, .end = 0x00bb, .idx = -19 }, ++ { .start = 0x00d7, .end = 0x00d7, .idx = -46 }, ++ { .start = 0x060c, .end = 0x060c, .idx = -1378 }, ++ { .start = 0x061b, .end = 0x064b, .idx = -1392 }, ++ { .start = 0x0660, .end = 0x066d, .idx = -1412 }, ++ { .start = 0x06f0, .end = 0x06f9, .idx = -1542 }, ++ { .start = 0xf8f9, .end = 0xf8fb, .idx = -63493 }, ++ { .start = 0xfb56, .end = 0xfb58, .idx = -64095 }, ++ { .start = 0xfb7a, .end = 0xfb7c, .idx = -64128 }, ++ { .start = 0xfb8a, .end = 0xfb94, .idx = -64141 }, ++ { .start = 0xfba4, .end = 0xfba4, .idx = -64156 }, ++ { .start = 0xfbfc, .end = 0xfbfe, .idx = -64243 }, ++ { .start = 0xfe80, .end = 0xfeee, .idx = -64884 }, ++ { .start = 0xffff, .end = 0xffff, .idx = 0 } + }; + + static const char from_ucs4[] = +diff --git a/iconvdata/ibm1112.h b/iconvdata/ibm1112.h +index 447106d0de..36cdd2df08 100644 +--- a/iconvdata/ibm1112.h ++++ b/iconvdata/ibm1112.h +@@ -88,17 +88,17 @@ static const uint32_t to_ucs4[256] = + + static const struct gap from_idx[] = + { +- { start: 0x0000, end: 0x00c9, idx: 0 }, +- { start: 0x00d3, end: 0x00e9, idx: -9 }, +- { start: 0x00f3, end: 0x0119, idx: -18 }, +- { start: 0x0122, end: 0x0123, idx: -26 }, +- { start: 0x012a, end: 0x012f, idx: -32 }, +- { start: 0x0136, end: 0x014d, idx: -38 }, +- { start: 0x0156, end: 0x0161, idx: -46 }, +- { start: 0x016a, end: 0x016b, idx: -54 }, +- { start: 0x0172, end: 0x017e, idx: -60 }, +- { start: 0x2019, end: 0x201e, idx: -7894 }, +- { start: 0xffff, end: 0xffff, idx: 0 } ++ { .start = 0x0000, .end = 0x00c9, .idx = 0 }, ++ { .start = 0x00d3, .end = 0x00e9, .idx = -9 }, ++ { .start = 0x00f3, .end = 0x0119, .idx = -18 }, ++ { .start = 0x0122, .end = 0x0123, .idx = -26 }, ++ { .start = 0x012a, .end = 0x012f, .idx = -32 }, ++ { .start = 0x0136, .end = 0x014d, .idx = -38 }, ++ { .start = 0x0156, .end = 0x0161, .idx = -46 }, ++ { .start = 0x016a, .end = 0x016b, .idx = -54 }, ++ { .start = 0x0172, .end = 0x017e, .idx = -60 }, ++ { .start = 0x2019, .end = 0x201e, .idx = -7894 }, ++ { .start = 0xffff, .end = 0xffff, .idx = 0 } + }; + + static const char from_ucs4[] = +diff --git a/iconvdata/ibm1122.h b/iconvdata/ibm1122.h +index e07adea29c..b2d217ad8f 100644 +--- a/iconvdata/ibm1122.h ++++ b/iconvdata/ibm1122.h +@@ -88,11 +88,11 @@ static const uint32_t to_ucs4[256] = + + static const struct gap from_idx[] = + { +- { start: 0x0000, end: 0x00ff, idx: 0 }, +- { start: 0x0160, end: 0x0161, idx: -96 }, +- { start: 0x017d, end: 0x017e, idx: -123 }, +- { start: 0x203e, end: 0x203e, idx: -7994 }, +- { start: 0xffff, end: 0xffff, idx: 0 } ++ { .start = 0x0000, .end = 0x00ff, .idx = 0 }, ++ { .start = 0x0160, .end = 0x0161, .idx = -96 }, ++ { .start = 0x017d, .end = 0x017e, .idx = -123 }, ++ { .start = 0x203e, .end = 0x203e, .idx = -7994 }, ++ { .start = 0xffff, .end = 0xffff, .idx = 0 } + }; + + static const char from_ucs4[] = +diff --git a/iconvdata/ibm1123.h b/iconvdata/ibm1123.h +index 468e80a664..87a7a44ad7 100644 +--- a/iconvdata/ibm1123.h ++++ b/iconvdata/ibm1123.h +@@ -88,12 +88,12 @@ static const uint32_t to_ucs4[256] = + + static const struct gap from_idx[] = + { +- { start: 0x0000, end: 0x00a0, idx: 0 }, +- { start: 0x00a7, end: 0x00ad, idx: -6 }, +- { start: 0x0401, end: 0x045f, idx: -857 }, +- { start: 0x0490, end: 0x0491, idx: -905 }, +- { start: 0x2116, end: 0x2116, idx: -8205 }, +- { start: 0xffff, end: 0xffff, idx: 0 } ++ { .start = 0x0000, .end = 0x00a0, .idx = 0 }, ++ { .start = 0x00a7, .end = 0x00ad, .idx = -6 }, ++ { .start = 0x0401, .end = 0x045f, .idx = -857 }, ++ { .start = 0x0490, .end = 0x0491, .idx = -905 }, ++ { .start = 0x2116, .end = 0x2116, .idx = -8205 }, ++ { .start = 0xffff, .end = 0xffff, .idx = 0 } + }; + + static const char from_ucs4[] = +diff --git a/iconvdata/ibm1130.h b/iconvdata/ibm1130.h +index c016a06d61..cf65b5b2ba 100644 +--- a/iconvdata/ibm1130.h ++++ b/iconvdata/ibm1130.h +@@ -88,16 +88,16 @@ static const uint32_t to_ucs4[256] = + + static const struct gap from_idx[] = + { +- { start: 0x0000, end: 0x0103, idx: 0 }, +- { start: 0x0110, end: 0x0111, idx: -12 }, +- { start: 0x0152, end: 0x0153, idx: -76 }, +- { start: 0x0178, end: 0x0178, idx: -112 }, +- { start: 0x01a0, end: 0x01a1, idx: -151 }, +- { start: 0x01af, end: 0x01b0, idx: -164 }, +- { start: 0x0300, end: 0x0309, idx: -499 }, +- { start: 0x0323, end: 0x0323, idx: -524 }, +- { start: 0x20ab, end: 0x20ab, idx: -8083 }, +- { start: 0xffff, end: 0xffff, idx: 0 } ++ { .start = 0x0000, .end = 0x0103, .idx = 0 }, ++ { .start = 0x0110, .end = 0x0111, .idx = -12 }, ++ { .start = 0x0152, .end = 0x0153, .idx = -76 }, ++ { .start = 0x0178, .end = 0x0178, .idx = -112 }, ++ { .start = 0x01a0, .end = 0x01a1, .idx = -151 }, ++ { .start = 0x01af, .end = 0x01b0, .idx = -164 }, ++ { .start = 0x0300, .end = 0x0309, .idx = -499 }, ++ { .start = 0x0323, .end = 0x0323, .idx = -524 }, ++ { .start = 0x20ab, .end = 0x20ab, .idx = -8083 }, ++ { .start = 0xffff, .end = 0xffff, .idx = 0 } + }; + + static const char from_ucs4[] = +diff --git a/iconvdata/ibm1137.h b/iconvdata/ibm1137.h +index 68159b5108..cc7867be7f 100644 +--- a/iconvdata/ibm1137.h ++++ b/iconvdata/ibm1137.h +@@ -88,11 +88,11 @@ static const uint32_t to_ucs4[256] = + + static const struct gap from_idx[] = + { +- { start: 0x0000, end: 0x00a0, idx: 0 }, +- { start: 0x0901, end: 0x0952, idx: -2144 }, +- { start: 0x0960, end: 0x0970, idx: -2157 }, +- { start: 0x200c, end: 0x200d, idx: -7944 }, +- { start: 0xffff, end: 0xffff, idx: 0 } ++ { .start = 0x0000, .end = 0x00a0, .idx = 0 }, ++ { .start = 0x0901, .end = 0x0952, .idx = -2144 }, ++ { .start = 0x0960, .end = 0x0970, .idx = -2157 }, ++ { .start = 0x200c, .end = 0x200d, .idx = -7944 }, ++ { .start = 0xffff, .end = 0xffff, .idx = 0 } + }; + + static const char from_ucs4[] = +diff --git a/iconvdata/ibm1140.h b/iconvdata/ibm1140.h +index 9f251d9c12..f60d41c9f6 100644 +--- a/iconvdata/ibm1140.h ++++ b/iconvdata/ibm1140.h +@@ -88,10 +88,10 @@ static const uint32_t to_ucs4[256] = + + static const struct gap from_idx[] = + { +- { start: 0x0000, end: 0x00ff, idx: 0 }, +- { start: 0x203e, end: 0x203e, idx: -7998 }, +- { start: 0x20ac, end: 0x20ac, idx: -8107 }, +- { start: 0xffff, end: 0xffff, idx: 0 } ++ { .start = 0x0000, .end = 0x00ff, .idx = 0 }, ++ { .start = 0x203e, .end = 0x203e, .idx = -7998 }, ++ { .start = 0x20ac, .end = 0x20ac, .idx = -8107 }, ++ { .start = 0xffff, .end = 0xffff, .idx = 0 } + }; + + static const char from_ucs4[] = +diff --git a/iconvdata/ibm1141.h b/iconvdata/ibm1141.h +index 737f82c0d2..6927de5cae 100644 +--- a/iconvdata/ibm1141.h ++++ b/iconvdata/ibm1141.h +@@ -88,10 +88,10 @@ static const uint32_t to_ucs4[256] = + + static const struct gap from_idx[] = + { +- { start: 0x0000, end: 0x00ff, idx: 0 }, +- { start: 0x203e, end: 0x203e, idx: -7998 }, +- { start: 0x20ac, end: 0x20ac, idx: -8107 }, +- { start: 0xffff, end: 0xffff, idx: 0 } ++ { .start = 0x0000, .end = 0x00ff, .idx = 0 }, ++ { .start = 0x203e, .end = 0x203e, .idx = -7998 }, ++ { .start = 0x20ac, .end = 0x20ac, .idx = -8107 }, ++ { .start = 0xffff, .end = 0xffff, .idx = 0 } + }; + + static const char from_ucs4[] = +diff --git a/iconvdata/ibm1142.h b/iconvdata/ibm1142.h +index be2e6f22ad..d9ed34756e 100644 +--- a/iconvdata/ibm1142.h ++++ b/iconvdata/ibm1142.h +@@ -88,10 +88,10 @@ static const uint32_t to_ucs4[256] = + + static const struct gap from_idx[] = + { +- { start: 0x0000, end: 0x00ff, idx: 0 }, +- { start: 0x203e, end: 0x203e, idx: -7998 }, +- { start: 0x20ac, end: 0x20ac, idx: -8107 }, +- { start: 0xffff, end: 0xffff, idx: 0 } ++ { .start = 0x0000, .end = 0x00ff, .idx = 0 }, ++ { .start = 0x203e, .end = 0x203e, .idx = -7998 }, ++ { .start = 0x20ac, .end = 0x20ac, .idx = -8107 }, ++ { .start = 0xffff, .end = 0xffff, .idx = 0 } + }; + + static const char from_ucs4[] = +diff --git a/iconvdata/ibm1143.h b/iconvdata/ibm1143.h +index b726652864..d0b94aaee3 100644 +--- a/iconvdata/ibm1143.h ++++ b/iconvdata/ibm1143.h +@@ -88,10 +88,10 @@ static const uint32_t to_ucs4[256] = + + static const struct gap from_idx[] = + { +- { start: 0x0000, end: 0x00ff, idx: 0 }, +- { start: 0x203e, end: 0x203e, idx: -7998 }, +- { start: 0x20ac, end: 0x20ac, idx: -8107 }, +- { start: 0xffff, end: 0xffff, idx: 0 } ++ { .start = 0x0000, .end = 0x00ff, .idx = 0 }, ++ { .start = 0x203e, .end = 0x203e, .idx = -7998 }, ++ { .start = 0x20ac, .end = 0x20ac, .idx = -8107 }, ++ { .start = 0xffff, .end = 0xffff, .idx = 0 } + }; + + static const char from_ucs4[] = +diff --git a/iconvdata/ibm1144.h b/iconvdata/ibm1144.h +index fbe890a502..7108bf0852 100644 +--- a/iconvdata/ibm1144.h ++++ b/iconvdata/ibm1144.h +@@ -88,10 +88,10 @@ static const uint32_t to_ucs4[256] = + + static const struct gap from_idx[] = + { +- { start: 0x0000, end: 0x00ff, idx: 0 }, +- { start: 0x203e, end: 0x203e, idx: -7998 }, +- { start: 0x20ac, end: 0x20ac, idx: -8107 }, +- { start: 0xffff, end: 0xffff, idx: 0 } ++ { .start = 0x0000, .end = 0x00ff, .idx = 0 }, ++ { .start = 0x203e, .end = 0x203e, .idx = -7998 }, ++ { .start = 0x20ac, .end = 0x20ac, .idx = -8107 }, ++ { .start = 0xffff, .end = 0xffff, .idx = 0 } + }; + + static const char from_ucs4[] = +diff --git a/iconvdata/ibm1145.h b/iconvdata/ibm1145.h +index ee2c6960b6..9f39e96386 100644 +--- a/iconvdata/ibm1145.h ++++ b/iconvdata/ibm1145.h +@@ -88,10 +88,10 @@ static const uint32_t to_ucs4[256] = + + static const struct gap from_idx[] = + { +- { start: 0x0000, end: 0x00ff, idx: 0 }, +- { start: 0x203e, end: 0x203e, idx: -7998 }, +- { start: 0x20ac, end: 0x20ac, idx: -8107 }, +- { start: 0xffff, end: 0xffff, idx: 0 } ++ { .start = 0x0000, .end = 0x00ff, .idx = 0 }, ++ { .start = 0x203e, .end = 0x203e, .idx = -7998 }, ++ { .start = 0x20ac, .end = 0x20ac, .idx = -8107 }, ++ { .start = 0xffff, .end = 0xffff, .idx = 0 } + }; + + static const char from_ucs4[] = +diff --git a/iconvdata/ibm1146.h b/iconvdata/ibm1146.h +index 5e9cbfd790..71e816b5b9 100644 +--- a/iconvdata/ibm1146.h ++++ b/iconvdata/ibm1146.h +@@ -88,10 +88,10 @@ static const uint32_t to_ucs4[256] = + + static const struct gap from_idx[] = + { +- { start: 0x0000, end: 0x00ff, idx: 0 }, +- { start: 0x203e, end: 0x203e, idx: -7998 }, +- { start: 0x20ac, end: 0x20ac, idx: -8107 }, +- { start: 0xffff, end: 0xffff, idx: 0 } ++ { .start = 0x0000, .end = 0x00ff, .idx = 0 }, ++ { .start = 0x203e, .end = 0x203e, .idx = -7998 }, ++ { .start = 0x20ac, .end = 0x20ac, .idx = -8107 }, ++ { .start = 0xffff, .end = 0xffff, .idx = 0 } + }; + + static const char from_ucs4[] = +diff --git a/iconvdata/ibm1147.h b/iconvdata/ibm1147.h +index c5adff9def..97c1b81a76 100644 +--- a/iconvdata/ibm1147.h ++++ b/iconvdata/ibm1147.h +@@ -88,10 +88,10 @@ static const uint32_t to_ucs4[256] = + + static const struct gap from_idx[] = + { +- { start: 0x0000, end: 0x00ff, idx: 0 }, +- { start: 0x203e, end: 0x203e, idx: -7998 }, +- { start: 0x20ac, end: 0x20ac, idx: -8107 }, +- { start: 0xffff, end: 0xffff, idx: 0 } ++ { .start = 0x0000, .end = 0x00ff, .idx = 0 }, ++ { .start = 0x203e, .end = 0x203e, .idx = -7998 }, ++ { .start = 0x20ac, .end = 0x20ac, .idx = -8107 }, ++ { .start = 0xffff, .end = 0xffff, .idx = 0 } + }; + + static const char from_ucs4[] = +diff --git a/iconvdata/ibm1148.h b/iconvdata/ibm1148.h +index e5d37dff2c..2b9a6e5995 100644 +--- a/iconvdata/ibm1148.h ++++ b/iconvdata/ibm1148.h +@@ -88,10 +88,10 @@ static const uint32_t to_ucs4[256] = + + static const struct gap from_idx[] = + { +- { start: 0x0000, end: 0x00ff, idx: 0 }, +- { start: 0x203e, end: 0x203e, idx: -7998 }, +- { start: 0x20ac, end: 0x20ac, idx: -8107 }, +- { start: 0xffff, end: 0xffff, idx: 0 } ++ { .start = 0x0000, .end = 0x00ff, .idx = 0 }, ++ { .start = 0x203e, .end = 0x203e, .idx = -7998 }, ++ { .start = 0x20ac, .end = 0x20ac, .idx = -8107 }, ++ { .start = 0xffff, .end = 0xffff, .idx = 0 } + }; + + static const char from_ucs4[] = +diff --git a/iconvdata/ibm1149.h b/iconvdata/ibm1149.h +index 34a7e0b9ca..3cd72adc09 100644 +--- a/iconvdata/ibm1149.h ++++ b/iconvdata/ibm1149.h +@@ -88,10 +88,10 @@ static const uint32_t to_ucs4[256] = + + static const struct gap from_idx[] = + { +- { start: 0x0000, end: 0x00ff, idx: 0 }, +- { start: 0x203e, end: 0x203e, idx: -7998 }, +- { start: 0x20ac, end: 0x20ac, idx: -8107 }, +- { start: 0xffff, end: 0xffff, idx: 0 } ++ { .start = 0x0000, .end = 0x00ff, .idx = 0 }, ++ { .start = 0x203e, .end = 0x203e, .idx = -7998 }, ++ { .start = 0x20ac, .end = 0x20ac, .idx = -8107 }, ++ { .start = 0xffff, .end = 0xffff, .idx = 0 } + }; + + static const char from_ucs4[] = +diff --git a/iconvdata/ibm1153.h b/iconvdata/ibm1153.h +index 08b373f9da..e1e6ecfe9c 100644 +--- a/iconvdata/ibm1153.h ++++ b/iconvdata/ibm1153.h +@@ -88,18 +88,18 @@ static const uint32_t to_ucs4[256] = + + static const struct gap from_idx[] = + { +- { start: 0x0000, end: 0x00a0, idx: 0 }, +- { start: 0x00a7, end: 0x00b8, idx: -6 }, +- { start: 0x00c1, end: 0x0111, idx: -14 }, +- { start: 0x0118, end: 0x011b, idx: -20 }, +- { start: 0x0139, end: 0x0148, idx: -49 }, +- { start: 0x0150, end: 0x0165, idx: -56 }, +- { start: 0x016e, end: 0x0171, idx: -64 }, +- { start: 0x0179, end: 0x017e, idx: -71 }, +- { start: 0x02c7, end: 0x02c7, idx: -399 }, +- { start: 0x02d8, end: 0x02dd, idx: -415 }, +- { start: 0x20ac, end: 0x20ac, idx: -8045 }, +- { start: 0xffff, end: 0xffff, idx: 0 } ++ { .start = 0x0000, .end = 0x00a0, .idx = 0 }, ++ { .start = 0x00a7, .end = 0x00b8, .idx = -6 }, ++ { .start = 0x00c1, .end = 0x0111, .idx = -14 }, ++ { .start = 0x0118, .end = 0x011b, .idx = -20 }, ++ { .start = 0x0139, .end = 0x0148, .idx = -49 }, ++ { .start = 0x0150, .end = 0x0165, .idx = -56 }, ++ { .start = 0x016e, .end = 0x0171, .idx = -64 }, ++ { .start = 0x0179, .end = 0x017e, .idx = -71 }, ++ { .start = 0x02c7, .end = 0x02c7, .idx = -399 }, ++ { .start = 0x02d8, .end = 0x02dd, .idx = -415 }, ++ { .start = 0x20ac, .end = 0x20ac, .idx = -8045 }, ++ { .start = 0xffff, .end = 0xffff, .idx = 0 } + }; + + static const char from_ucs4[] = +diff --git a/iconvdata/ibm1154.h b/iconvdata/ibm1154.h +index 56f47a0b02..276002fff3 100644 +--- a/iconvdata/ibm1154.h ++++ b/iconvdata/ibm1154.h +@@ -88,12 +88,12 @@ static const uint32_t to_ucs4[256] = + + static const struct gap from_idx[] = + { +- { start: 0x0000, end: 0x00a0, idx: 0 }, +- { start: 0x00ad, end: 0x00ad, idx: -12 }, +- { start: 0x0401, end: 0x045f, idx: -863 }, +- { start: 0x20ac, end: 0x20ac, idx: -8107 }, +- { start: 0x2116, end: 0x2116, idx: -8212 }, +- { start: 0xffff, end: 0xffff, idx: 0 } ++ { .start = 0x0000, .end = 0x00a0, .idx = 0 }, ++ { .start = 0x00ad, .end = 0x00ad, .idx = -12 }, ++ { .start = 0x0401, .end = 0x045f, .idx = -863 }, ++ { .start = 0x20ac, .end = 0x20ac, .idx = -8107 }, ++ { .start = 0x2116, .end = 0x2116, .idx = -8212 }, ++ { .start = 0xffff, .end = 0xffff, .idx = 0 } + }; + + static const char from_ucs4[] = +diff --git a/iconvdata/ibm1155.h b/iconvdata/ibm1155.h +index d091276eee..cc8152bb42 100644 +--- a/iconvdata/ibm1155.h ++++ b/iconvdata/ibm1155.h +@@ -88,12 +88,12 @@ static const uint32_t to_ucs4[256] = + + static const struct gap from_idx[] = + { +- { start: 0x0000, end: 0x00ff, idx: 0 }, +- { start: 0x011e, end: 0x011f, idx: -30 }, +- { start: 0x0130, end: 0x0131, idx: -46 }, +- { start: 0x015e, end: 0x015f, idx: -90 }, +- { start: 0x20ac, end: 0x20ac, idx: -8102 }, +- { start: 0xffff, end: 0xffff, idx: 0 } ++ { .start = 0x0000, .end = 0x00ff, .idx = 0 }, ++ { .start = 0x011e, .end = 0x011f, .idx = -30 }, ++ { .start = 0x0130, .end = 0x0131, .idx = -46 }, ++ { .start = 0x015e, .end = 0x015f, .idx = -90 }, ++ { .start = 0x20ac, .end = 0x20ac, .idx = -8102 }, ++ { .start = 0xffff, .end = 0xffff, .idx = 0 } + }; + + static const char from_ucs4[] = +diff --git a/iconvdata/ibm1156.h b/iconvdata/ibm1156.h +index 71c1d986cc..c46d3dcf37 100644 +--- a/iconvdata/ibm1156.h ++++ b/iconvdata/ibm1156.h +@@ -88,18 +88,18 @@ static const uint32_t to_ucs4[256] = + + static const struct gap from_idx[] = + { +- { start: 0x0000, end: 0x00c9, idx: 0 }, +- { start: 0x00d3, end: 0x00e9, idx: -9 }, +- { start: 0x00f3, end: 0x0119, idx: -18 }, +- { start: 0x0122, end: 0x0123, idx: -26 }, +- { start: 0x012a, end: 0x012f, idx: -32 }, +- { start: 0x0136, end: 0x014d, idx: -38 }, +- { start: 0x0156, end: 0x0161, idx: -46 }, +- { start: 0x016a, end: 0x016b, idx: -54 }, +- { start: 0x0172, end: 0x017e, idx: -60 }, +- { start: 0x2019, end: 0x201e, idx: -7894 }, +- { start: 0x20ac, end: 0x20ac, idx: -8035 }, +- { start: 0xffff, end: 0xffff, idx: 0 } ++ { .start = 0x0000, .end = 0x00c9, .idx = 0 }, ++ { .start = 0x00d3, .end = 0x00e9, .idx = -9 }, ++ { .start = 0x00f3, .end = 0x0119, .idx = -18 }, ++ { .start = 0x0122, .end = 0x0123, .idx = -26 }, ++ { .start = 0x012a, .end = 0x012f, .idx = -32 }, ++ { .start = 0x0136, .end = 0x014d, .idx = -38 }, ++ { .start = 0x0156, .end = 0x0161, .idx = -46 }, ++ { .start = 0x016a, .end = 0x016b, .idx = -54 }, ++ { .start = 0x0172, .end = 0x017e, .idx = -60 }, ++ { .start = 0x2019, .end = 0x201e, .idx = -7894 }, ++ { .start = 0x20ac, .end = 0x20ac, .idx = -8035 }, ++ { .start = 0xffff, .end = 0xffff, .idx = 0 } + }; + + static const char from_ucs4[] = +diff --git a/iconvdata/ibm1157.h b/iconvdata/ibm1157.h +index 71fc42bdbf..63b5c9e30c 100644 +--- a/iconvdata/ibm1157.h ++++ b/iconvdata/ibm1157.h +@@ -88,12 +88,12 @@ static const uint32_t to_ucs4[256] = + + static const struct gap from_idx[] = + { +- { start: 0x0000, end: 0x00ff, idx: 0 }, +- { start: 0x0160, end: 0x0161, idx: -96 }, +- { start: 0x017d, end: 0x017e, idx: -123 }, +- { start: 0x203e, end: 0x203e, idx: -7994 }, +- { start: 0x20ac, end: 0x20ac, idx: -8103 }, +- { start: 0xffff, end: 0xffff, idx: 0 } ++ { .start = 0x0000, .end = 0x00ff, .idx = 0 }, ++ { .start = 0x0160, .end = 0x0161, .idx = -96 }, ++ { .start = 0x017d, .end = 0x017e, .idx = -123 }, ++ { .start = 0x203e, .end = 0x203e, .idx = -7994 }, ++ { .start = 0x20ac, .end = 0x20ac, .idx = -8103 }, ++ { .start = 0xffff, .end = 0xffff, .idx = 0 } + }; + + static const char from_ucs4[] = +diff --git a/iconvdata/ibm1158.h b/iconvdata/ibm1158.h +index cfec136fd2..15b7624994 100644 +--- a/iconvdata/ibm1158.h ++++ b/iconvdata/ibm1158.h +@@ -88,13 +88,13 @@ static const uint32_t to_ucs4[256] = + + static const struct gap from_idx[] = + { +- { start: 0x0000, end: 0x00a0, idx: 0 }, +- { start: 0x00ad, end: 0x00ad, idx: -12 }, +- { start: 0x0401, end: 0x045f, idx: -863 }, +- { start: 0x0490, end: 0x0491, idx: -911 }, +- { start: 0x20ac, end: 0x20ac, idx: -8105 }, +- { start: 0x2116, end: 0x2116, idx: -8210 }, +- { start: 0xffff, end: 0xffff, idx: 0 } ++ { .start = 0x0000, .end = 0x00a0, .idx = 0 }, ++ { .start = 0x00ad, .end = 0x00ad, .idx = -12 }, ++ { .start = 0x0401, .end = 0x045f, .idx = -863 }, ++ { .start = 0x0490, .end = 0x0491, .idx = -911 }, ++ { .start = 0x20ac, .end = 0x20ac, .idx = -8105 }, ++ { .start = 0x2116, .end = 0x2116, .idx = -8210 }, ++ { .start = 0xffff, .end = 0xffff, .idx = 0 } + }; + + static const char from_ucs4[] = +diff --git a/iconvdata/ibm1166.h b/iconvdata/ibm1166.h +index a6f1266d23..2486be5cc3 100644 +--- a/iconvdata/ibm1166.h ++++ b/iconvdata/ibm1166.h +@@ -88,19 +88,19 @@ static const uint32_t to_ucs4[256] = + + static const struct gap from_idx[] = + { +- { start: 0x0000, end: 0x00a0, idx: 0 }, +- { start: 0x00ad, end: 0x00ad, idx: -12 }, +- { start: 0x0401, end: 0x045e, idx: -863 }, +- { start: 0x0492, end: 0x0493, idx: -914 }, +- { start: 0x049a, end: 0x049b, idx: -920 }, +- { start: 0x04a2, end: 0x04a3, idx: -926 }, +- { start: 0x04ae, end: 0x04b1, idx: -936 }, +- { start: 0x04ba, end: 0x04bb, idx: -944 }, +- { start: 0x04d8, end: 0x04d9, idx: -972 }, +- { start: 0x04e8, end: 0x04e9, idx: -986 }, +- { start: 0x20ac, end: 0x20ac, idx: -8092 }, +- { start: 0x2116, end: 0x2116, idx: -8197 }, +- { start: 0xffff, end: 0xffff, idx: 0 } ++ { .start = 0x0000, .end = 0x00a0, .idx = 0 }, ++ { .start = 0x00ad, .end = 0x00ad, .idx = -12 }, ++ { .start = 0x0401, .end = 0x045e, .idx = -863 }, ++ { .start = 0x0492, .end = 0x0493, .idx = -914 }, ++ { .start = 0x049a, .end = 0x049b, .idx = -920 }, ++ { .start = 0x04a2, .end = 0x04a3, .idx = -926 }, ++ { .start = 0x04ae, .end = 0x04b1, .idx = -936 }, ++ { .start = 0x04ba, .end = 0x04bb, .idx = -944 }, ++ { .start = 0x04d8, .end = 0x04d9, .idx = -972 }, ++ { .start = 0x04e8, .end = 0x04e9, .idx = -986 }, ++ { .start = 0x20ac, .end = 0x20ac, .idx = -8092 }, ++ { .start = 0x2116, .end = 0x2116, .idx = -8197 }, ++ { .start = 0xffff, .end = 0xffff, .idx = 0 } + }; + + static const char from_ucs4[] = +diff --git a/iconvdata/ibm1167.h b/iconvdata/ibm1167.h +index 15e913487a..16ea3369af 100644 +--- a/iconvdata/ibm1167.h ++++ b/iconvdata/ibm1167.h +@@ -88,28 +88,28 @@ static const uint32_t to_ucs4[256] = + + static const struct gap from_idx[] = + { +- { start: 0x0000, end: 0x007f, idx: 0 }, +- { start: 0x00a0, end: 0x00ae, idx: -32 }, +- { start: 0x00b7, end: 0x00bb, idx: -40 }, +- { start: 0x0401, end: 0x0407, idx: -877 }, +- { start: 0x040e, end: 0x0457, idx: -883 }, +- { start: 0x045e, end: 0x045e, idx: -889 }, +- { start: 0x0490, end: 0x0491, idx: -938 }, +- { start: 0x2014, end: 0x2014, idx: -7980 }, +- { start: 0x201c, end: 0x201d, idx: -7987 }, +- { start: 0x2116, end: 0x2116, idx: -8235 }, +- { start: 0x2122, end: 0x2122, idx: -8246 }, +- { start: 0x2219, end: 0x2219, idx: -8492 }, +- { start: 0x2500, end: 0x2502, idx: -9234 }, +- { start: 0x250c, end: 0x251c, idx: -9243 }, +- { start: 0x2524, end: 0x2524, idx: -9250 }, +- { start: 0x252c, end: 0x252c, idx: -9257 }, +- { start: 0x2534, end: 0x2534, idx: -9264 }, +- { start: 0x253c, end: 0x253c, idx: -9271 }, +- { start: 0x2550, end: 0x256a, idx: -9290 }, +- { start: 0x2580, end: 0x2593, idx: -9311 }, +- { start: 0x25a0, end: 0x25a0, idx: -9323 }, +- { start: 0xffff, end: 0xffff, idx: 0 } ++ { .start = 0x0000, .end = 0x007f, .idx = 0 }, ++ { .start = 0x00a0, .end = 0x00ae, .idx = -32 }, ++ { .start = 0x00b7, .end = 0x00bb, .idx = -40 }, ++ { .start = 0x0401, .end = 0x0407, .idx = -877 }, ++ { .start = 0x040e, .end = 0x0457, .idx = -883 }, ++ { .start = 0x045e, .end = 0x045e, .idx = -889 }, ++ { .start = 0x0490, .end = 0x0491, .idx = -938 }, ++ { .start = 0x2014, .end = 0x2014, .idx = -7980 }, ++ { .start = 0x201c, .end = 0x201d, .idx = -7987 }, ++ { .start = 0x2116, .end = 0x2116, .idx = -8235 }, ++ { .start = 0x2122, .end = 0x2122, .idx = -8246 }, ++ { .start = 0x2219, .end = 0x2219, .idx = -8492 }, ++ { .start = 0x2500, .end = 0x2502, .idx = -9234 }, ++ { .start = 0x250c, .end = 0x251c, .idx = -9243 }, ++ { .start = 0x2524, .end = 0x2524, .idx = -9250 }, ++ { .start = 0x252c, .end = 0x252c, .idx = -9257 }, ++ { .start = 0x2534, .end = 0x2534, .idx = -9264 }, ++ { .start = 0x253c, .end = 0x253c, .idx = -9271 }, ++ { .start = 0x2550, .end = 0x256a, .idx = -9290 }, ++ { .start = 0x2580, .end = 0x2593, .idx = -9311 }, ++ { .start = 0x25a0, .end = 0x25a0, .idx = -9323 }, ++ { .start = 0xffff, .end = 0xffff, .idx = 0 } + }; + + static const char from_ucs4[] = +diff --git a/iconvdata/ibm12712.h b/iconvdata/ibm12712.h +index c2ba499e53..20673953fb 100644 +--- a/iconvdata/ibm12712.h ++++ b/iconvdata/ibm12712.h +@@ -81,17 +81,17 @@ static const uint32_t to_ucs4[256] = + + static const struct gap from_idx[] = + { +- { start: 0x0000, end: 0x00be, idx: 0 }, +- { start: 0x00d7, end: 0x00d7, idx: -24 }, +- { start: 0x00f7, end: 0x00f7, idx: -55 }, +- { start: 0x05d0, end: 0x05ea, idx: -1295 }, +- { start: 0x200e, end: 0x200f, idx: -7986 }, +- { start: 0x2017, end: 0x2017, idx: -7993 }, +- { start: 0x2022, end: 0x2022, idx: -8003 }, +- { start: 0x202a, end: 0x202e, idx: -8010 }, +- { start: 0x203e, end: 0x203e, idx: -8025 }, +- { start: 0x20aa, end: 0x20ac, idx: -8132 }, +- { start: 0xffff, end: 0xffff, idx: 0 } ++ { .start = 0x0000, .end = 0x00be, .idx = 0 }, ++ { .start = 0x00d7, .end = 0x00d7, .idx = -24 }, ++ { .start = 0x00f7, .end = 0x00f7, .idx = -55 }, ++ { .start = 0x05d0, .end = 0x05ea, .idx = -1295 }, ++ { .start = 0x200e, .end = 0x200f, .idx = -7986 }, ++ { .start = 0x2017, .end = 0x2017, .idx = -7993 }, ++ { .start = 0x2022, .end = 0x2022, .idx = -8003 }, ++ { .start = 0x202a, .end = 0x202e, .idx = -8010 }, ++ { .start = 0x203e, .end = 0x203e, .idx = -8025 }, ++ { .start = 0x20aa, .end = 0x20ac, .idx = -8132 }, ++ { .start = 0xffff, .end = 0xffff, .idx = 0 } + }; + + static const char from_ucs4[] = +diff --git a/iconvdata/ibm16804.h b/iconvdata/ibm16804.h +index ed57fdd44d..c7d638aa1f 100644 +--- a/iconvdata/ibm16804.h ++++ b/iconvdata/ibm16804.h +@@ -87,17 +87,17 @@ static const uint32_t to_ucs4[256] = + + static const struct gap from_idx[] = + { +- { start: 0x0000, end: 0x00ad, idx: 0 }, +- { start: 0x00d7, end: 0x00d7, idx: -41 }, +- { start: 0x00f7, end: 0x00f7, idx: -72 }, +- { start: 0x060c, end: 0x060c, idx: -1372 }, +- { start: 0x061b, end: 0x064a, idx: -1386 }, +- { start: 0x0651, end: 0x0651, idx: -1392 }, +- { start: 0x0660, end: 0x066d, idx: -1406 }, +- { start: 0x2007, end: 0x200b, idx: -7959 }, +- { start: 0x20ac, end: 0x20ac, idx: -8119 }, +- { start: 0xfe7c, end: 0xfefc, idx: -64902 }, +- { start: 0xffff, end: 0xffff, idx: 0 } ++ { .start = 0x0000, .end = 0x00ad, .idx = 0 }, ++ { .start = 0x00d7, .end = 0x00d7, .idx = -41 }, ++ { .start = 0x00f7, .end = 0x00f7, .idx = -72 }, ++ { .start = 0x060c, .end = 0x060c, .idx = -1372 }, ++ { .start = 0x061b, .end = 0x064a, .idx = -1386 }, ++ { .start = 0x0651, .end = 0x0651, .idx = -1392 }, ++ { .start = 0x0660, .end = 0x066d, .idx = -1406 }, ++ { .start = 0x2007, .end = 0x200b, .idx = -7959 }, ++ { .start = 0x20ac, .end = 0x20ac, .idx = -8119 }, ++ { .start = 0xfe7c, .end = 0xfefc, .idx = -64902 }, ++ { .start = 0xffff, .end = 0xffff, .idx = 0 } + }; + + static const char from_ucs4[] = +diff --git a/iconvdata/ibm4517.h b/iconvdata/ibm4517.h +index dc390d7d01..aad5e2d3b7 100644 +--- a/iconvdata/ibm4517.h ++++ b/iconvdata/ibm4517.h +@@ -85,18 +85,18 @@ static const uint32_t to_ucs4[256] = + + static const struct gap from_idx[] = + { +- { start: 0x0000, end: 0x00b5, idx: 0 }, +- { start: 0x00d7, end: 0x00d7, idx: -33 }, +- { start: 0x00e1, end: 0x00e9, idx: -42 }, +- { start: 0x00f7, end: 0x00fa, idx: -55 }, +- { start: 0x060c, end: 0x060c, idx: -1352 }, +- { start: 0x061b, end: 0x064a, idx: -1366 }, +- { start: 0x0651, end: 0x0651, idx: -1372 }, +- { start: 0x0660, end: 0x066d, idx: -1386 }, +- { start: 0x2007, end: 0x200b, idx: -7939 }, +- { start: 0xf8f4, end: 0xf8f7, idx: -63467 }, +- { start: 0xfe70, end: 0xfefc, idx: -64867 }, +- { start: 0xffff, end: 0xffff, idx: 0 } ++ { .start = 0x0000, .end = 0x00b5, .idx = 0 }, ++ { .start = 0x00d7, .end = 0x00d7, .idx = -33 }, ++ { .start = 0x00e1, .end = 0x00e9, .idx = -42 }, ++ { .start = 0x00f7, .end = 0x00fa, .idx = -55 }, ++ { .start = 0x060c, .end = 0x060c, .idx = -1352 }, ++ { .start = 0x061b, .end = 0x064a, .idx = -1366 }, ++ { .start = 0x0651, .end = 0x0651, .idx = -1372 }, ++ { .start = 0x0660, .end = 0x066d, .idx = -1386 }, ++ { .start = 0x2007, .end = 0x200b, .idx = -7939 }, ++ { .start = 0xf8f4, .end = 0xf8f7, .idx = -63467 }, ++ { .start = 0xfe70, .end = 0xfefc, .idx = -64867 }, ++ { .start = 0xffff, .end = 0xffff, .idx = 0 } + }; + + static const char from_ucs4[] = +diff --git a/iconvdata/ibm4899.h b/iconvdata/ibm4899.h +index ad368642cf..bbe0d64656 100644 +--- a/iconvdata/ibm4899.h ++++ b/iconvdata/ibm4899.h +@@ -65,14 +65,14 @@ static const uint32_t to_ucs4[256] = + + static const struct gap from_idx[] = + { +- { start: 0x0000, end: 0x005f, idx: 0 }, +- { start: 0x007c, end: 0x00a2, idx: -28 }, +- { start: 0x00ac, end: 0x00ac, idx: -37 }, +- { start: 0x05d0, end: 0x05ea, idx: -1352 }, +- { start: 0x200e, end: 0x200f, idx: -8043 }, +- { start: 0x202a, end: 0x202e, idx: -8069 }, +- { start: 0x20aa, end: 0x20ac, idx: -8192 }, +- { start: 0xffff, end: 0xffff, idx: 0 } ++ { .start = 0x0000, .end = 0x005f, .idx = 0 }, ++ { .start = 0x007c, .end = 0x00a2, .idx = -28 }, ++ { .start = 0x00ac, .end = 0x00ac, .idx = -37 }, ++ { .start = 0x05d0, .end = 0x05ea, .idx = -1352 }, ++ { .start = 0x200e, .end = 0x200f, .idx = -8043 }, ++ { .start = 0x202a, .end = 0x202e, .idx = -8069 }, ++ { .start = 0x20aa, .end = 0x20ac, .idx = -8192 }, ++ { .start = 0xffff, .end = 0xffff, .idx = 0 } + }; + + static const char from_ucs4[] = +diff --git a/iconvdata/ibm4909.h b/iconvdata/ibm4909.h +index e7783e605a..886878ad8f 100644 +--- a/iconvdata/ibm4909.h ++++ b/iconvdata/ibm4909.h +@@ -87,12 +87,12 @@ static const uint32_t to_ucs4[256] = + + static const struct gap from_idx[] = + { +- { start: 0x0000, end: 0x00bd, idx: 0 }, +- { start: 0x0385, end: 0x03ce, idx: -711 }, +- { start: 0x03d5, end: 0x03d5, idx: -717 }, +- { start: 0x2015, end: 0x2019, idx: -7948 }, +- { start: 0x20ac, end: 0x20ac, idx: -8094 }, +- { start: 0xffff, end: 0xffff, idx: 0 } ++ { .start = 0x0000, .end = 0x00bd, .idx = 0 }, ++ { .start = 0x0385, .end = 0x03ce, .idx = -711 }, ++ { .start = 0x03d5, .end = 0x03d5, .idx = -717 }, ++ { .start = 0x2015, .end = 0x2019, .idx = -7948 }, ++ { .start = 0x20ac, .end = 0x20ac, .idx = -8094 }, ++ { .start = 0xffff, .end = 0xffff, .idx = 0 } + }; + + static const char from_ucs4[] = +diff --git a/iconvdata/ibm4971.h b/iconvdata/ibm4971.h +index 5cb273df9f..a4adb2d148 100644 +--- a/iconvdata/ibm4971.h ++++ b/iconvdata/ibm4971.h +@@ -87,12 +87,12 @@ static const uint32_t to_ucs4[256] = + + static const struct gap from_idx[] = + { +- { start: 0x0000, end: 0x00bd, idx: 0 }, +- { start: 0x0385, end: 0x03ce, idx: -711 }, +- { start: 0x03d5, end: 0x03d5, idx: -717 }, +- { start: 0x2015, end: 0x2019, idx: -7948 }, +- { start: 0x20ac, end: 0x20ac, idx: -8094 }, +- { start: 0xffff, end: 0xffff, idx: 0 } ++ { .start = 0x0000, .end = 0x00bd, .idx = 0 }, ++ { .start = 0x0385, .end = 0x03ce, .idx = -711 }, ++ { .start = 0x03d5, .end = 0x03d5, .idx = -717 }, ++ { .start = 0x2015, .end = 0x2019, .idx = -7948 }, ++ { .start = 0x20ac, .end = 0x20ac, .idx = -8094 }, ++ { .start = 0xffff, .end = 0xffff, .idx = 0 } + }; + + static const char from_ucs4[] = +diff --git a/iconvdata/ibm5347.h b/iconvdata/ibm5347.h +index 917391b2ea..187039d5c9 100644 +--- a/iconvdata/ibm5347.h ++++ b/iconvdata/ibm5347.h +@@ -88,18 +88,18 @@ static const uint32_t to_ucs4[256] = + + static const struct gap from_idx[] = + { +- { start: 0x0000, end: 0x007f, idx: 0 }, +- { start: 0x0098, end: 0x0098, idx: -24 }, +- { start: 0x00a0, end: 0x00bb, idx: -31 }, +- { start: 0x0401, end: 0x045f, idx: -868 }, +- { start: 0x0490, end: 0x0491, idx: -916 }, +- { start: 0x2013, end: 0x2026, idx: -7957 }, +- { start: 0x2030, end: 0x2030, idx: -7966 }, +- { start: 0x2039, end: 0x203a, idx: -7974 }, +- { start: 0x20ac, end: 0x20ac, idx: -8087 }, +- { start: 0x2116, end: 0x2116, idx: -8192 }, +- { start: 0x2122, end: 0x2122, idx: -8203 }, +- { start: 0xffff, end: 0xffff, idx: 0 } ++ { .start = 0x0000, .end = 0x007f, .idx = 0 }, ++ { .start = 0x0098, .end = 0x0098, .idx = -24 }, ++ { .start = 0x00a0, .end = 0x00bb, .idx = -31 }, ++ { .start = 0x0401, .end = 0x045f, .idx = -868 }, ++ { .start = 0x0490, .end = 0x0491, .idx = -916 }, ++ { .start = 0x2013, .end = 0x2026, .idx = -7957 }, ++ { .start = 0x2030, .end = 0x2030, .idx = -7966 }, ++ { .start = 0x2039, .end = 0x203a, .idx = -7974 }, ++ { .start = 0x20ac, .end = 0x20ac, .idx = -8087 }, ++ { .start = 0x2116, .end = 0x2116, .idx = -8192 }, ++ { .start = 0x2122, .end = 0x2122, .idx = -8203 }, ++ { .start = 0xffff, .end = 0xffff, .idx = 0 } + }; + + static const char from_ucs4[] = +diff --git a/iconvdata/ibm803.h b/iconvdata/ibm803.h +index eb06f7565a..3e92234f80 100644 +--- a/iconvdata/ibm803.h ++++ b/iconvdata/ibm803.h +@@ -63,11 +63,11 @@ static const uint32_t to_ucs4[256] = + + static const struct gap from_idx[] = + { +- { start: 0x0000, end: 0x005f, idx: 0 }, +- { start: 0x007c, end: 0x00a2, idx: -28 }, +- { start: 0x00ac, end: 0x00ac, idx: -37 }, +- { start: 0x05d0, end: 0x05ea, idx: -1352 }, +- { start: 0xffff, end: 0xffff, idx: 0 } ++ { .start = 0x0000, .end = 0x005f, .idx = 0 }, ++ { .start = 0x007c, .end = 0x00a2, .idx = -28 }, ++ { .start = 0x00ac, .end = 0x00ac, .idx = -37 }, ++ { .start = 0x05d0, .end = 0x05ea, .idx = -1352 }, ++ { .start = 0xffff, .end = 0xffff, .idx = 0 } + }; + + static const char from_ucs4[] = +diff --git a/iconvdata/ibm901.h b/iconvdata/ibm901.h +index b8d6d204ab..ce4c73af42 100644 +--- a/iconvdata/ibm901.h ++++ b/iconvdata/ibm901.h +@@ -88,39 +88,39 @@ static const uint32_t to_ucs4[256] = + + static const struct gap from_idx[] = + { +- { start: 0x0000, end: 0x00c9, idx: 0 }, +- { start: 0x00d3, end: 0x00e9, idx: -9 }, +- { start: 0x00f3, end: 0x0119, idx: -18 }, +- { start: 0x0122, end: 0x0123, idx: -26 }, +- { start: 0x012a, end: 0x012f, idx: -32 }, +- { start: 0x0136, end: 0x014d, idx: -38 }, +- { start: 0x0156, end: 0x0161, idx: -46 }, +- { start: 0x016a, end: 0x016b, idx: -54 }, +- { start: 0x0172, end: 0x017e, idx: -60 }, +- { start: 0x2017, end: 0x2022, idx: -7892 }, +- { start: 0x203c, end: 0x203e, idx: -7917 }, +- { start: 0x20ac, end: 0x20ac, idx: -8026 }, +- { start: 0x2190, end: 0x2195, idx: -8253 }, +- { start: 0x21a8, end: 0x21a8, idx: -8271 }, +- { start: 0x221f, end: 0x221f, idx: -8389 }, +- { start: 0x2500, end: 0x2502, idx: -9125 }, +- { start: 0x250c, end: 0x251c, idx: -9134 }, +- { start: 0x2524, end: 0x2524, idx: -9141 }, +- { start: 0x252c, end: 0x252c, idx: -9148 }, +- { start: 0x2534, end: 0x2534, idx: -9155 }, +- { start: 0x253c, end: 0x253c, idx: -9162 }, +- { start: 0x2550, end: 0x256c, idx: -9181 }, +- { start: 0x2580, end: 0x2588, idx: -9200 }, +- { start: 0x2591, end: 0x2593, idx: -9208 }, +- { start: 0x25a0, end: 0x25a0, idx: -9220 }, +- { start: 0x25ac, end: 0x25b2, idx: -9231 }, +- { start: 0x25ba, end: 0x25bc, idx: -9238 }, +- { start: 0x25c4, end: 0x25c4, idx: -9245 }, +- { start: 0x25cb, end: 0x25cb, idx: -9251 }, +- { start: 0x25d8, end: 0x25d9, idx: -9263 }, +- { start: 0x263a, end: 0x2642, idx: -9359 }, +- { start: 0x2660, end: 0x266c, idx: -9388 }, +- { start: 0xffff, end: 0xffff, idx: 0 } ++ { .start = 0x0000, .end = 0x00c9, .idx = 0 }, ++ { .start = 0x00d3, .end = 0x00e9, .idx = -9 }, ++ { .start = 0x00f3, .end = 0x0119, .idx = -18 }, ++ { .start = 0x0122, .end = 0x0123, .idx = -26 }, ++ { .start = 0x012a, .end = 0x012f, .idx = -32 }, ++ { .start = 0x0136, .end = 0x014d, .idx = -38 }, ++ { .start = 0x0156, .end = 0x0161, .idx = -46 }, ++ { .start = 0x016a, .end = 0x016b, .idx = -54 }, ++ { .start = 0x0172, .end = 0x017e, .idx = -60 }, ++ { .start = 0x2017, .end = 0x2022, .idx = -7892 }, ++ { .start = 0x203c, .end = 0x203e, .idx = -7917 }, ++ { .start = 0x20ac, .end = 0x20ac, .idx = -8026 }, ++ { .start = 0x2190, .end = 0x2195, .idx = -8253 }, ++ { .start = 0x21a8, .end = 0x21a8, .idx = -8271 }, ++ { .start = 0x221f, .end = 0x221f, .idx = -8389 }, ++ { .start = 0x2500, .end = 0x2502, .idx = -9125 }, ++ { .start = 0x250c, .end = 0x251c, .idx = -9134 }, ++ { .start = 0x2524, .end = 0x2524, .idx = -9141 }, ++ { .start = 0x252c, .end = 0x252c, .idx = -9148 }, ++ { .start = 0x2534, .end = 0x2534, .idx = -9155 }, ++ { .start = 0x253c, .end = 0x253c, .idx = -9162 }, ++ { .start = 0x2550, .end = 0x256c, .idx = -9181 }, ++ { .start = 0x2580, .end = 0x2588, .idx = -9200 }, ++ { .start = 0x2591, .end = 0x2593, .idx = -9208 }, ++ { .start = 0x25a0, .end = 0x25a0, .idx = -9220 }, ++ { .start = 0x25ac, .end = 0x25b2, .idx = -9231 }, ++ { .start = 0x25ba, .end = 0x25bc, .idx = -9238 }, ++ { .start = 0x25c4, .end = 0x25c4, .idx = -9245 }, ++ { .start = 0x25cb, .end = 0x25cb, .idx = -9251 }, ++ { .start = 0x25d8, .end = 0x25d9, .idx = -9263 }, ++ { .start = 0x263a, .end = 0x2642, .idx = -9359 }, ++ { .start = 0x2660, .end = 0x266c, .idx = -9388 }, ++ { .start = 0xffff, .end = 0xffff, .idx = 0 } + }; + + static const char from_ucs4[] = +diff --git a/iconvdata/ibm902.h b/iconvdata/ibm902.h +index 2a0b5f91b9..3eab9f890f 100644 +--- a/iconvdata/ibm902.h ++++ b/iconvdata/ibm902.h +@@ -88,35 +88,35 @@ static const uint32_t to_ucs4[256] = + + static const struct gap from_idx[] = + { +- { start: 0x0000, end: 0x00ff, idx: 0 }, +- { start: 0x0160, end: 0x0161, idx: -96 }, +- { start: 0x017d, end: 0x017e, idx: -123 }, +- { start: 0x2017, end: 0x2017, idx: -7955 }, +- { start: 0x2022, end: 0x2022, idx: -7965 }, +- { start: 0x203c, end: 0x203e, idx: -7990 }, +- { start: 0x20ac, end: 0x20ac, idx: -8099 }, +- { start: 0x2190, end: 0x2195, idx: -8326 }, +- { start: 0x21a8, end: 0x21a8, idx: -8344 }, +- { start: 0x221f, end: 0x221f, idx: -8462 }, +- { start: 0x2264, end: 0x2265, idx: -8530 }, +- { start: 0x2500, end: 0x2502, idx: -9196 }, +- { start: 0x250c, end: 0x251c, idx: -9205 }, +- { start: 0x2524, end: 0x2524, idx: -9212 }, +- { start: 0x252c, end: 0x252c, idx: -9219 }, +- { start: 0x2534, end: 0x2534, idx: -9226 }, +- { start: 0x253c, end: 0x253c, idx: -9233 }, +- { start: 0x2550, end: 0x256c, idx: -9252 }, +- { start: 0x2580, end: 0x2588, idx: -9271 }, +- { start: 0x2591, end: 0x2593, idx: -9279 }, +- { start: 0x25a0, end: 0x25a0, idx: -9291 }, +- { start: 0x25ac, end: 0x25b2, idx: -9302 }, +- { start: 0x25ba, end: 0x25bc, idx: -9309 }, +- { start: 0x25c4, end: 0x25c4, idx: -9316 }, +- { start: 0x25cb, end: 0x25cb, idx: -9322 }, +- { start: 0x25d8, end: 0x25d9, idx: -9334 }, +- { start: 0x263a, end: 0x2642, idx: -9430 }, +- { start: 0x2660, end: 0x266c, idx: -9459 }, +- { start: 0xffff, end: 0xffff, idx: 0 } ++ { .start = 0x0000, .end = 0x00ff, .idx = 0 }, ++ { .start = 0x0160, .end = 0x0161, .idx = -96 }, ++ { .start = 0x017d, .end = 0x017e, .idx = -123 }, ++ { .start = 0x2017, .end = 0x2017, .idx = -7955 }, ++ { .start = 0x2022, .end = 0x2022, .idx = -7965 }, ++ { .start = 0x203c, .end = 0x203e, .idx = -7990 }, ++ { .start = 0x20ac, .end = 0x20ac, .idx = -8099 }, ++ { .start = 0x2190, .end = 0x2195, .idx = -8326 }, ++ { .start = 0x21a8, .end = 0x21a8, .idx = -8344 }, ++ { .start = 0x221f, .end = 0x221f, .idx = -8462 }, ++ { .start = 0x2264, .end = 0x2265, .idx = -8530 }, ++ { .start = 0x2500, .end = 0x2502, .idx = -9196 }, ++ { .start = 0x250c, .end = 0x251c, .idx = -9205 }, ++ { .start = 0x2524, .end = 0x2524, .idx = -9212 }, ++ { .start = 0x252c, .end = 0x252c, .idx = -9219 }, ++ { .start = 0x2534, .end = 0x2534, .idx = -9226 }, ++ { .start = 0x253c, .end = 0x253c, .idx = -9233 }, ++ { .start = 0x2550, .end = 0x256c, .idx = -9252 }, ++ { .start = 0x2580, .end = 0x2588, .idx = -9271 }, ++ { .start = 0x2591, .end = 0x2593, .idx = -9279 }, ++ { .start = 0x25a0, .end = 0x25a0, .idx = -9291 }, ++ { .start = 0x25ac, .end = 0x25b2, .idx = -9302 }, ++ { .start = 0x25ba, .end = 0x25bc, .idx = -9309 }, ++ { .start = 0x25c4, .end = 0x25c4, .idx = -9316 }, ++ { .start = 0x25cb, .end = 0x25cb, .idx = -9322 }, ++ { .start = 0x25d8, .end = 0x25d9, .idx = -9334 }, ++ { .start = 0x263a, .end = 0x2642, .idx = -9430 }, ++ { .start = 0x2660, .end = 0x266c, .idx = -9459 }, ++ { .start = 0xffff, .end = 0xffff, .idx = 0 } + }; + + static const char from_ucs4[] = +diff --git a/iconvdata/ibm9030.h b/iconvdata/ibm9030.h +index de7983c412..644fa20486 100644 +--- a/iconvdata/ibm9030.h ++++ b/iconvdata/ibm9030.h +@@ -88,9 +88,9 @@ static const uint32_t to_ucs4[256] = + + static const struct gap from_idx[] = + { +- { start: 0x0000, end: 0x00ac, idx: 0 }, +- { start: 0x0e01, end: 0x0e5b, idx: -3412 }, +- { start: 0xffff, end: 0xffff, idx: 0 } ++ { .start = 0x0000, .end = 0x00ac, .idx = 0 }, ++ { .start = 0x0e01, .end = 0x0e5b, .idx = -3412 }, ++ { .start = 0xffff, .end = 0xffff, .idx = 0 } + }; + + static const char from_ucs4[] = +diff --git a/iconvdata/ibm9066.h b/iconvdata/ibm9066.h +index 9894faa4a9..d8c1e2e298 100644 +--- a/iconvdata/ibm9066.h ++++ b/iconvdata/ibm9066.h +@@ -80,10 +80,10 @@ static const uint32_t to_ucs4[256] = + + static const struct gap from_idx[] = + { +- { start: 0x0000, end: 0x007f, idx: 0 }, +- { start: 0x00a0, end: 0x00ac, idx: -32 }, +- { start: 0x0e01, end: 0x0e5b, idx: -3444 }, +- { start: 0xffff, end: 0xffff, idx: 0 } ++ { .start = 0x0000, .end = 0x007f, .idx = 0 }, ++ { .start = 0x00a0, .end = 0x00ac, .idx = -32 }, ++ { .start = 0x0e01, .end = 0x0e5b, .idx = -3444 }, ++ { .start = 0xffff, .end = 0xffff, .idx = 0 } + }; + + static const char from_ucs4[] = +diff --git a/iconvdata/ibm921.h b/iconvdata/ibm921.h +index 9a070fb96c..2de5c14089 100644 +--- a/iconvdata/ibm921.h ++++ b/iconvdata/ibm921.h +@@ -88,17 +88,17 @@ static const uint32_t to_ucs4[256] = + + static const struct gap from_idx[] = + { +- { start: 0x0000, end: 0x00c9, idx: 0 }, +- { start: 0x00d3, end: 0x00e9, idx: -9 }, +- { start: 0x00f3, end: 0x0119, idx: -18 }, +- { start: 0x0122, end: 0x0123, idx: -26 }, +- { start: 0x012a, end: 0x012f, idx: -32 }, +- { start: 0x0136, end: 0x014d, idx: -38 }, +- { start: 0x0156, end: 0x0161, idx: -46 }, +- { start: 0x016a, end: 0x016b, idx: -54 }, +- { start: 0x0172, end: 0x017e, idx: -60 }, +- { start: 0x2019, end: 0x201e, idx: -7894 }, +- { start: 0xffff, end: 0xffff, idx: 0 } ++ { .start = 0x0000, .end = 0x00c9, .idx = 0 }, ++ { .start = 0x00d3, .end = 0x00e9, .idx = -9 }, ++ { .start = 0x00f3, .end = 0x0119, .idx = -18 }, ++ { .start = 0x0122, .end = 0x0123, .idx = -26 }, ++ { .start = 0x012a, .end = 0x012f, .idx = -32 }, ++ { .start = 0x0136, .end = 0x014d, .idx = -38 }, ++ { .start = 0x0156, .end = 0x0161, .idx = -46 }, ++ { .start = 0x016a, .end = 0x016b, .idx = -54 }, ++ { .start = 0x0172, .end = 0x017e, .idx = -60 }, ++ { .start = 0x2019, .end = 0x201e, .idx = -7894 }, ++ { .start = 0xffff, .end = 0xffff, .idx = 0 } + }; + + static const char from_ucs4[] = +diff --git a/iconvdata/ibm9448.h b/iconvdata/ibm9448.h +index b66121ad07..8aa0b28466 100644 +--- a/iconvdata/ibm9448.h ++++ b/iconvdata/ibm9448.h +@@ -88,37 +88,37 @@ static const uint32_t to_ucs4[256] = + + static const struct gap from_idx[] = + { +- { start: 0x0000, end: 0x007f, idx: 0 }, +- { start: 0x00a0, end: 0x00be, idx: -32 }, +- { start: 0x00d7, end: 0x00d7, idx: -56 }, +- { start: 0x00e0, end: 0x00fc, idx: -64 }, +- { start: 0x0152, end: 0x0153, idx: -149 }, +- { start: 0x0191, end: 0x0192, idx: -210 }, +- { start: 0x02c6, end: 0x02cb, idx: -517 }, +- { start: 0x060c, end: 0x060c, idx: -1349 }, +- { start: 0x061b, end: 0x0652, idx: -1363 }, +- { start: 0x0660, end: 0x066c, idx: -1376 }, +- { start: 0x0679, end: 0x067e, idx: -1388 }, +- { start: 0x0686, end: 0x0688, idx: -1395 }, +- { start: 0x0691, end: 0x0691, idx: -1403 }, +- { start: 0x0698, end: 0x0698, idx: -1409 }, +- { start: 0x06a9, end: 0x06af, idx: -1425 }, +- { start: 0x06ba, end: 0x06c1, idx: -1435 }, +- { start: 0x06cc, end: 0x06d2, idx: -1445 }, +- { start: 0x06f0, end: 0x06f9, idx: -1474 }, +- { start: 0x200c, end: 0x2026, idx: -7892 }, +- { start: 0x2030, end: 0x2030, idx: -7901 }, +- { start: 0x2039, end: 0x203e, idx: -7909 }, +- { start: 0x20ac, end: 0x20ac, idx: -8018 }, +- { start: 0x2122, end: 0x2122, idx: -8135 }, +- { start: 0xfb56, end: 0xfb59, idx: -63994 }, +- { start: 0xfb66, end: 0xfb69, idx: -64006 }, +- { start: 0xfb7a, end: 0xfb7d, idx: -64022 }, +- { start: 0xfb88, end: 0xfb95, idx: -64032 }, +- { start: 0xfb9e, end: 0xfb9f, idx: -64040 }, +- { start: 0xfba6, end: 0xfbaf, idx: -64046 }, +- { start: 0xfe70, end: 0xfef4, idx: -64750 }, +- { start: 0xffff, end: 0xffff, idx: 0 } ++ { .start = 0x0000, .end = 0x007f, .idx = 0 }, ++ { .start = 0x00a0, .end = 0x00be, .idx = -32 }, ++ { .start = 0x00d7, .end = 0x00d7, .idx = -56 }, ++ { .start = 0x00e0, .end = 0x00fc, .idx = -64 }, ++ { .start = 0x0152, .end = 0x0153, .idx = -149 }, ++ { .start = 0x0191, .end = 0x0192, .idx = -210 }, ++ { .start = 0x02c6, .end = 0x02cb, .idx = -517 }, ++ { .start = 0x060c, .end = 0x060c, .idx = -1349 }, ++ { .start = 0x061b, .end = 0x0652, .idx = -1363 }, ++ { .start = 0x0660, .end = 0x066c, .idx = -1376 }, ++ { .start = 0x0679, .end = 0x067e, .idx = -1388 }, ++ { .start = 0x0686, .end = 0x0688, .idx = -1395 }, ++ { .start = 0x0691, .end = 0x0691, .idx = -1403 }, ++ { .start = 0x0698, .end = 0x0698, .idx = -1409 }, ++ { .start = 0x06a9, .end = 0x06af, .idx = -1425 }, ++ { .start = 0x06ba, .end = 0x06c1, .idx = -1435 }, ++ { .start = 0x06cc, .end = 0x06d2, .idx = -1445 }, ++ { .start = 0x06f0, .end = 0x06f9, .idx = -1474 }, ++ { .start = 0x200c, .end = 0x2026, .idx = -7892 }, ++ { .start = 0x2030, .end = 0x2030, .idx = -7901 }, ++ { .start = 0x2039, .end = 0x203e, .idx = -7909 }, ++ { .start = 0x20ac, .end = 0x20ac, .idx = -8018 }, ++ { .start = 0x2122, .end = 0x2122, .idx = -8135 }, ++ { .start = 0xfb56, .end = 0xfb59, .idx = -63994 }, ++ { .start = 0xfb66, .end = 0xfb69, .idx = -64006 }, ++ { .start = 0xfb7a, .end = 0xfb7d, .idx = -64022 }, ++ { .start = 0xfb88, .end = 0xfb95, .idx = -64032 }, ++ { .start = 0xfb9e, .end = 0xfb9f, .idx = -64040 }, ++ { .start = 0xfba6, .end = 0xfbaf, .idx = -64046 }, ++ { .start = 0xfe70, .end = 0xfef4, .idx = -64750 }, ++ { .start = 0xffff, .end = 0xffff, .idx = 0 } + }; + + static const char from_ucs4[] = +-- +2.39.3 diff --git a/backport-clang-0023-catgets-Remove-catgets-config-h.patch b/backport-clang-0023-catgets-Remove-catgets-config-h.patch new file mode 100644 index 0000000000000000000000000000000000000000..5b11a7c99161ec6d839c6a678f5773bb76d7ad37 --- /dev/null +++ b/backport-clang-0023-catgets-Remove-catgets-config-h.patch @@ -0,0 +1,55 @@ +From 6f0386066e1c2ffd6a8e8beb21c95bf5d49bf02c Mon Sep 17 00:00:00 2001 +From: Adhemerval Zanella +Date: Thu, 10 Mar 2022 10:52:14 -0300 +Subject: [PATCH] catgets: Remove catgets/config.h + +It simplifies the code a bit and avoid the clang warning: + + ./config.h:12:2: error: #include_next in file found relative to primary + source file or found by absolute path; will search from start of include + path [-Werror,-Winclude-next-absolute-path] + #include_next + ^ +--- + catgets/config.h | 14 -------------- + catgets/gencat.c | 3 ++- + 2 files changed, 2 insertions(+), 15 deletions(-) + delete mode 100644 catgets/config.h + +diff --git a/catgets/config.h b/catgets/config.h +deleted file mode 100644 +index ce7887b351..0000000000 +--- a/catgets/config.h ++++ /dev/null +@@ -1,14 +0,0 @@ +-#ifndef _CG_CONFIG_H +-#define _CG_CONFIG_H +- +-/* Use the internal textdomain used for libc messages. */ +-#define PACKAGE _libc_intl_domainname +-#ifndef VERSION +-/* Get libc version number. */ +-#include "../version.h" +-#endif +- +- +-#include_next +- +-#endif +diff --git a/catgets/gencat.c b/catgets/gencat.c +index 63bdbf86a6..bfb40e6f2a 100644 +--- a/catgets/gencat.c ++++ b/catgets/gencat.c +@@ -14,8 +14,9 @@ + You should have received a copy of the GNU General Public License + along with this program; if not, see . */ + ++#define PACKAGE _libc_intl_domainname + #ifdef HAVE_CONFIG_H +-# include "config.h" ++# include + #endif + + #include +-- +2.39.3 diff --git a/backport-clang-0024-configure-Use-Wno-maybe-uninitialized-iff-compiler-supports.patch b/backport-clang-0024-configure-Use-Wno-maybe-uninitialized-iff-compiler-supports.patch new file mode 100644 index 0000000000000000000000000000000000000000..36bec3b9120b11dafe5143a3f7bdae6ff54b96f8 --- /dev/null +++ b/backport-clang-0024-configure-Use-Wno-maybe-uninitialized-iff-compiler-supports.patch @@ -0,0 +1,82 @@ +From ed5dc493c8d6817b642e2337a4488985cf046886 Mon Sep 17 00:00:00 2001 +From: Adhemerval Zanella +Date: Thu, 10 Mar 2022 16:40:29 -0300 +Subject: [PATCH] configure: Use -Wno-maybe-uninitialized iff compiler supports + it + +clang does not support the flag. +--- + configure | 24 ++++++++++++++++++++++++ + configure.ac | 8 ++++++++ + timezone/Makefile | 2 +- + 3 files changed, 33 insertions(+), 1 deletion(-) + +diff --git a/configure b/configure +index eeb3ef49b8..45ee893d49 100755 +--- a/configure ++++ b/configure +@@ -7194,6 +7194,30 @@ printf "%s\n" "$libc_cv_wno_ignored_attributes" >&6; } + config_vars="$config_vars + config-cflags-wno-ignored-attributes = $libc_cv_wno_ignored_attributes" + ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -Wno-maybe-uninitialized" >&5 ++printf %s "checking for -Wno-maybe-uninitialized... " >&6; } ++if test ${libc_cv_wno_maybe_uninitialized+y} ++then : ++ printf %s "(cached) " >&6 ++else $as_nop ++ if { ac_try='${CC-cc} -Werror -Wno-maybe-uninitialized -xc /dev/null -S -o /dev/null' ++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; } ++then : ++ libc_cv_wno_maybe_uninitialized=-Wno-maybe-uninitialized ++else $as_nop ++ libc_cv_wno_maybe_uninitialized= ++fi ++ ++fi ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_wno_maybe_uninitialized" >&5 ++printf "%s\n" "$libc_cv_wno_maybe_uninitialized" >&6; } ++config_vars="$config_vars ++config-cflags-wno-maybe-uninitialized = $libc_cv_wno_maybe_uninitialized" ++ + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether cc puts quotes around section names" >&5 + printf %s "checking whether cc puts quotes around section names... " >&6; } + if test ${libc_cv_have_section_quotes+y} +diff --git a/configure.ac b/configure.ac +index 6601331a06..7a7fe4a28a 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1394,6 +1394,14 @@ rm -f conftest*]) + LIBC_CONFIG_VAR([config-cflags-wno-ignored-attributes], + [$libc_cv_wno_ignored_attributes]) + ++AC_CACHE_CHECK([for -Wno-maybe-uninitialized], libc_cv_wno_maybe_uninitialized, [dnl ++ LIBC_TRY_CC_OPTION([-Werror -Wno-maybe-uninitialized], ++ [libc_cv_wno_maybe_uninitialized=-Wno-maybe-uninitialized], ++ [libc_cv_wno_maybe_uninitialized=]) ++]) ++LIBC_CONFIG_VAR([config-cflags-wno-maybe-uninitialized], ++ [$libc_cv_wno_maybe_uninitialized]) ++ + AC_CACHE_CHECK(whether cc puts quotes around section names, + libc_cv_have_section_quotes, + [cat > conftest.c < +Date: Thu, 10 Mar 2022 16:44:45 -0300 +Subject: [PATCH] timezone: Fix clang operator precedence warning + +clang issues: + +zdump.c:669:7: error: operator '?:' has lower precedence than '&'; '&' +will be evaluated first [-Werror,-Wbitwise-conditional-parentheses] + ? (delta(&tm, &lotm) == t - lot + +which is exactly what the code intendes. Instead of adding a +warning suppress, place parentheses around the '&' expression. +--- + timezone/zdump.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/timezone/zdump.c b/timezone/zdump.c +index b532fe3eae..bfc01faffa 100644 +--- a/timezone/zdump.c ++++ b/timezone/zdump.c +@@ -665,7 +665,7 @@ hunt(timezone_t tz, char *name, time_t lot, time_t hit) + else if (t >= hit) + --t; + tm_ok = my_localtime_rz(tz, &t, &tm) != NULL; +- if (lotm_ok & tm_ok ++ if ((lotm_ok & tm_ok) + ? (delta(&tm, &lotm) == t - lot + && tm.tm_isdst == lotm.tm_isdst + && strcmp(abbr(&tm), ab) == 0) +-- +2.39.3 diff --git a/backport-clang-0026-support-Handle-clang-support-dtotimespec-c-on-dtotimespec.patch b/backport-clang-0026-support-Handle-clang-support-dtotimespec-c-on-dtotimespec.patch new file mode 100644 index 0000000000000000000000000000000000000000..915dd3b3b37085ee8ce4da4389892854dc0512d6 --- /dev/null +++ b/backport-clang-0026-support-Handle-clang-support-dtotimespec-c-on-dtotimespec.patch @@ -0,0 +1,37 @@ +From 0a6178dcd6d1a6f60719615a7c99f6aaf236e71b Mon Sep 17 00:00:00 2001 +From: Adhemerval Zanella +Date: Mon, 20 Mar 2023 16:20:48 -0300 +Subject: [PATCH] support: Handle clang support/dtotimespec.c on dtotimespec + +clang issues: + +dtotimespec.c:31:25: error: implicit conversion from 'time_t' (aka +'long') to 'double' changes value from 9223372036854775807 to +9223372036854775808 [-Werror,-Wimplicit-const-int-float-conversion] + else if (sec >= 1.0 + TYPE_MAXIMUM (time_t)) + ~ ^~~~~~~~~~~~~~~~~~~~~ +../include/intprops.h:57:4: note: expanded from macro 'TYPE_MAXIMUM' + ((t) (! TYPE_SIGNED (t) +\ + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +So explicit cast it to double. +--- + support/dtotimespec.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/support/dtotimespec.c b/support/dtotimespec.c +index cde5b4d74c..45fa3a3e7f 100644 +--- a/support/dtotimespec.c ++++ b/support/dtotimespec.c +@@ -28,7 +28,7 @@ dtotimespec (double sec) + { + if (sec <= TYPE_MINIMUM (time_t)) + return make_timespec (TYPE_MINIMUM (time_t), 0); +- else if (sec >= 1.0 + TYPE_MAXIMUM (time_t)) ++ else if (sec >= 1.0 + (double) TYPE_MAXIMUM (time_t)) + return make_timespec (TYPE_MAXIMUM (time_t), TIMESPEC_HZ - 1); + else + { +-- +2.39.3 diff --git a/backport-clang-0027-support-Use-CHAR_MAX-as-maximum-value.patch b/backport-clang-0027-support-Use-CHAR_MAX-as-maximum-value.patch new file mode 100644 index 0000000000000000000000000000000000000000..c27b3f1316b8f5778ee3355847965d35c9950c96 --- /dev/null +++ b/backport-clang-0027-support-Use-CHAR_MAX-as-maximum-value.patch @@ -0,0 +1,34 @@ + From d10391ed68bdd2c512f308fdd90c2ffee4795710 Mon Sep 17 00:00:00 2001 +From: Adhemerval Zanella +Date: Tue, 15 Mar 2022 18:01:57 -0300 +Subject: [PATCH] support: Use CHAR_MAX as maximum value + +Instead of -1. +--- + support/support_process_state.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/support/support_process_state.c b/support/support_process_state.c +index dc2296f8dd..a656008034 100644 +--- a/support/support_process_state.c ++++ b/support/support_process_state.c +@@ -59,7 +59,7 @@ support_process_state_wait (pid_t pid, enum support_process_state state) + + for (;;) + { +- char cur_state = -1; ++ char cur_state = CHAR_MAX; + while (xgetline (&line, &linesiz, fstatus) > 0) + if (strncmp (line, "State:", strlen ("State:")) == 0) + { +@@ -67,7 +67,7 @@ support_process_state_wait (pid_t pid, enum support_process_state state) + break; + } + /* Fallback to nanosleep for invalid state. */ +- if (cur_state == -1) ++ if (cur_state == CHAR_MAX) + break; + + for (size_t i = 0; i < array_length (process_states); ++i) +-- +2.39.3 diff --git a/backport-clang-0028-localedata-Use-hexadecimal-character-escape-on-tests.patch b/backport-clang-0028-localedata-Use-hexadecimal-character-escape-on-tests.patch new file mode 100644 index 0000000000000000000000000000000000000000..5ed6ed3be3afa3e5ff5955943eaaf60caadbcc37 --- /dev/null +++ b/backport-clang-0028-localedata-Use-hexadecimal-character-escape-on-tests.patch @@ -0,0 +1,282 @@ +From 452fb3266489e94887fe718d09759e7a9f0556c0 Mon Sep 17 00:00:00 2001 +From: liyunfei +Date: Mon, 18 Dec 2023 11:10:46 +0800 +Subject: [PATCH] localedata: Use hexadecimal character escape on tests + +--- + localedata/bug-iconv-trans.c | 2 +- + localedata/tests-mbwc/dat_mbrtowc.c | 12 ++++++------ + localedata/tests-mbwc/dat_mbsrtowcs.c | 12 ++++++------ + localedata/tests-mbwc/dat_strcoll.c | 13 ++++++++----- + localedata/tests-mbwc/dat_swscanf.c | 2 +- + localedata/tests-mbwc/dat_wcrtomb.c | 4 ++-- + localedata/tests-mbwc/dat_wcsrtombs.c | 10 +++++----- + localedata/tests-mbwc/dat_wcstombs.c | 10 +++++----- + localedata/tests-mbwc/dat_wctomb.c | 4 ++-- + localedata/tst-xlocale1.c | 4 ++-- + localedata/tst-xlocale2.c | 2 +- + 11 files changed, 39 insertions(+), 36 deletions(-) + +diff --git a/localedata/bug-iconv-trans.c b/localedata/bug-iconv-trans.c +index f1a04165..c4c0ab74 100644 +--- a/localedata/bug-iconv-trans.c ++++ b/localedata/bug-iconv-trans.c +@@ -7,7 +7,7 @@ int + main (void) + { + iconv_t cd; +- const char str[] = "ÄäÖöÜüß"; ++ const char str[] = "\xc4\xe4\xd6\xf6\xdc\xfc\xdf"; + const char expected[] = "AEaeOEoeUEuess"; + char *inptr = (char *) str; + size_t inlen = strlen (str) + 1; +diff --git a/localedata/tests-mbwc/dat_mbrtowc.c b/localedata/tests-mbwc/dat_mbrtowc.c +index b8eb3dd2..a40a50b3 100644 +--- a/localedata/tests-mbwc/dat_mbrtowc.c ++++ b/localedata/tests-mbwc/dat_mbrtowc.c +@@ -23,9 +23,9 @@ TST_MBRTOWC tst_mbrtowc_loc [] = { + { /*----------------- #01 -----------------*/ + { + { +- { 1, 1, "ÄÖÜ", 1, 0, 0 }, +- { 1, 1, "ÄÖÜ", 2, 0, 0 }, +- { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 }, ++ { 1, 1, "\xc4\xd6\xdc", 1, 0, 0 }, ++ { 1, 1, "\xc4\xd6\xdc", 2, 0, 0 }, ++ { 1, 1, "\xc4\xd6\xdc", USE_MBCURMAX, 0, 0 }, + } + }, + { +@@ -39,9 +39,9 @@ TST_MBRTOWC tst_mbrtowc_loc [] = { + { /*----------------- #02 -----------------*/ + { + { +- { 1, 1, "ÄÖÜ", 1, 0, 0 }, +- { 1, 1, "ÄÖÜ", 2, 0, 0 }, +- { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 }, ++ { 1, 1, "\xc4\xd6\xdc", 1, 0, 0 }, ++ { 1, 1, "\xc4\xd6\xdc", 2, 0, 0 }, ++ { 1, 1, "\xc4\xd6\xdc", USE_MBCURMAX, 0, 0 }, + } + }, + { +diff --git a/localedata/tests-mbwc/dat_mbsrtowcs.c b/localedata/tests-mbwc/dat_mbsrtowcs.c +index e1ee1819..a632ea48 100644 +--- a/localedata/tests-mbwc/dat_mbsrtowcs.c ++++ b/localedata/tests-mbwc/dat_mbsrtowcs.c +@@ -15,9 +15,9 @@ TST_MBSRTOWCS tst_mbsrtowcs_loc [] = { + { /*----------------- #01 -----------------*/ + { + { +- { 1, "üäö", 4, 0,0 }, +- { 1, "üäö", 3, 0,0 }, +- { 1, "üäö", 2, 0,0 }, ++ { 1, "\xfc\xe4\xf6", 4, 0,0 }, ++ { 1, "\xfc\xe4\xf6", 3, 0,0 }, ++ { 1, "\xfc\xe4\xf6", 2, 0,0 }, + } + }, + { +@@ -31,9 +31,9 @@ TST_MBSRTOWCS tst_mbsrtowcs_loc [] = { + { /*----------------- #02 -----------------*/ + { + { +- { 1, "üäö", 4, 0,0 }, +- { 1, "", 1, 0,0 }, +- { 0, "üäö", 4, 0,0 }, ++ { 1, "\xfc\xe4\xf6", 4, 0,0 }, ++ { 1, "", 1, 0,0 }, ++ { 0, "\xfc\xe4\xf6", 4, 0,0 }, + } + }, + { +diff --git a/localedata/tests-mbwc/dat_strcoll.c b/localedata/tests-mbwc/dat_strcoll.c +index b729ae9e..73c9a285 100644 +--- a/localedata/tests-mbwc/dat_strcoll.c ++++ b/localedata/tests-mbwc/dat_strcoll.c +@@ -27,13 +27,16 @@ TST_STRCOLL tst_strcoll_loc [] = { + { + { Tstrcoll, TST_LOC_de }, + { +- { /*input.*/ { "ÄBCDEFG", "ÄBCDEFG" }, /* #1 */ ++ { /*input.*/ { "\xc4\x42\x43\x44\x45\x46\x47", ++ "\xc4\x42\x43\x44\x45\x46\x47" }, /* #1 */ + /*expect*/ { 0,1,0, }, + }, +- { /*input.*/ { "XX Ä XX", "XX B XX" }, /* #2 */ ++ { /*input.*/ { "\x58\x58\x20\xc4\x20\x58\x58", ++ "XX B XX" }, /* #2 */ + /*expect*/ { 0,0,-1, }, + }, +- { /*input.*/ { "XX B XX", "XX Ä XX" }, /* #3 */ ++ { /*input.*/ { "XX B XX", ++ "\x58\x58\x20\xc4\x20\x58\x58" }, /* #3 */ + /*expect*/ { 0,0,+1, }, + }, + { /*input.*/ { "B", "a" }, /* #4 */ +@@ -48,10 +51,10 @@ TST_STRCOLL tst_strcoll_loc [] = { + { /*input.*/ { "A", "b" }, /* #7 */ + /*expect*/ { 0,0,-1, }, + }, +- { /*input.*/ { "ä", "B" }, /* #8 */ ++ { /*input.*/ { "\xe4", "B" }, /* #8 */ + /*expect*/ { 0,0,-1, }, + }, +- { /*input.*/ { "B", "ä" }, /* #9 */ ++ { /*input.*/ { "B", "\xe4" }, /* #9 */ + /*expect*/ { 0,0,+1, }, + }, + { .is_last = 1 } /* Last element. */ +diff --git a/localedata/tests-mbwc/dat_swscanf.c b/localedata/tests-mbwc/dat_swscanf.c +index 7f658322..58823936 100644 +--- a/localedata/tests-mbwc/dat_swscanf.c ++++ b/localedata/tests-mbwc/dat_swscanf.c +@@ -31,7 +31,7 @@ TST_SWSCANF tst_swscanf_loc [] = + { /* The fields are: err_val, ret_flag, ret_val, + val_int, val_uns, val_flt, val_c, val_s, val_S. */ + 0,1,5, +- -1, 2, 3.3, 'ä', "ÄÜ", { 0x0000, }, ++ -1, 2, 3.3, '\xe4', "\xc4\xdc", { 0x0000, }, + }, + }, + /*------------------------ 02 -----------------------*/ +diff --git a/localedata/tests-mbwc/dat_wcrtomb.c b/localedata/tests-mbwc/dat_wcrtomb.c +index 8500f684..24568be4 100644 +--- a/localedata/tests-mbwc/dat_wcrtomb.c ++++ b/localedata/tests-mbwc/dat_wcrtomb.c +@@ -13,11 +13,11 @@ TST_WCRTOMB tst_wcrtomb_loc [] = { + { + /* #01 : normal case */ + { /*input.*/ { 1, 0x00FC, 0,0 }, +- /*expect*/ { 0, 1,1, "ü" }, ++ /*expect*/ { 0, 1,1, "\xfc" }, + }, + /* #02 : normal case */ + { /*input.*/ { 1, 0x00D6, 0,0 }, +- /*expect*/ { 0, 1,1, "Ö" }, ++ /*expect*/ { 0, 1,1, "\xd6" }, + }, + /* #03 : error case */ + { /*input.*/ { 1, 0xFFA1, 0,0 }, +diff --git a/localedata/tests-mbwc/dat_wcsrtombs.c b/localedata/tests-mbwc/dat_wcsrtombs.c +index d3148b2a..4fde9c6e 100644 +--- a/localedata/tests-mbwc/dat_wcsrtombs.c ++++ b/localedata/tests-mbwc/dat_wcsrtombs.c +@@ -26,26 +26,26 @@ TST_WCSRTOMBS tst_wcsrtombs_loc [] = { + }, + /* #02 : Only one chars should be stored in s. No null termination. */ + { /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 1, 0, 0 }, +- /*expect*/ { 0,1,1, "Ä" }, ++ /*expect*/ { 0,1,1, "\xc4" }, + }, + /* #03 : Only two chars should be stored in s. No null termination. */ + { /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 2, 0, 0 }, +- /*expect*/ { 0,1,2, "ÄÖ" }, ++ /*expect*/ { 0,1,2, "\xc4\xd6" }, + }, + /* #04 : Only three chars should be stored in s. No null + termination. */ + { /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 3, 0, 0 }, +- /*expect*/ { 0,1,3, "ÄÖÜ" }, ++ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" }, + }, + /* #05 : Only three chars should be stored in s with a null + termination. */ + { /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 4, 0, 0 }, +- /*expect*/ { 0,1,3, "ÄÖÜ" }, ++ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" }, + }, + /* #06 : Only three chars should be stored in s with a null + termination. */ + { /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 5, 0, 0 }, +- /*expect*/ { 0,1,3, "ÄÖÜ" }, ++ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" }, + }, + /* #07 : Invalid mb sequence. No chars should be stored in s. */ + { /*input.*/ { 1,1, { 0x0201,0x0221,0x0000,0x0000 }, 2, 0, 0 }, +diff --git a/localedata/tests-mbwc/dat_wcstombs.c b/localedata/tests-mbwc/dat_wcstombs.c +index a6dd0ec6..31a41924 100644 +--- a/localedata/tests-mbwc/dat_wcstombs.c ++++ b/localedata/tests-mbwc/dat_wcstombs.c +@@ -25,26 +25,26 @@ TST_WCSTOMBS tst_wcstombs_loc [] = { + }, + /* #02 : Only one chars should be stored in s. No null termination. */ + { /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 1 }, +- /*expect*/ { 0,1,1, "Ä" }, ++ /*expect*/ { 0,1,1, "\xc4" }, + }, + /* #03 : Only two chars should be stored in s. No null termination. */ + { /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 2 }, +- /*expect*/ { 0,1,2, "ÄÖ" }, ++ /*expect*/ { 0,1,2, "\xc4\xd6" }, + }, + /* #04 : Only three chars should be stored in s. No null + termination. */ + { /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 3 }, +- /*expect*/ { 0,1,3, "ÄÖÜ" }, ++ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" }, + }, + /* #05 : Only three chars should be stored in s with a null + termination. */ + { /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 4 }, +- /*expect*/ { 0,1,3, "ÄÖÜ" }, ++ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" }, + }, + /* #06 : Only three chars should be stored in s with a null + termination. */ + { /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 5 }, +- /*expect*/ { 0,1,3, "ÄÖÜ" }, ++ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" }, + }, + /* #07 : Invalid mb sequence. No chars should be stored in s. */ + { /*input.*/ { 1,1, { 0x0201,0x0221,0x0000,0x0000 }, 2 }, +diff --git a/localedata/tests-mbwc/dat_wctomb.c b/localedata/tests-mbwc/dat_wctomb.c +index 7394ca53..b8bd51de 100644 +--- a/localedata/tests-mbwc/dat_wctomb.c ++++ b/localedata/tests-mbwc/dat_wctomb.c +@@ -59,11 +59,11 @@ TST_WCTOMB tst_wctomb_loc [] = { + { + /* #01 : normal case */ + { /*input.*/ { 1, 0x00C4 }, +- /*expect*/ { 0,1,1, "Ä" }, ++ /*expect*/ { 0,1,1, "\xc4" }, + }, + /* #02 : normal case */ + { /*input.*/ { 1, 0x00DC }, +- /*expect*/ { 0,1,1, "Ü" }, ++ /*expect*/ { 0,1,1, "\xdc" }, + }, + /* #03 : normal case */ + { /*input.*/ { 1, 0x0092 }, +diff --git a/localedata/tst-xlocale1.c b/localedata/tst-xlocale1.c +index 9f545a02..e6c59707 100644 +--- a/localedata/tst-xlocale1.c ++++ b/localedata/tst-xlocale1.c +@@ -13,9 +13,9 @@ static struct + { + { "C", "TRANSLIT", "translit", 0 }, + { "de_DE.ISO-8859-1", "TRANSLIT", "translit", 0 }, +- { "de_DE.ISO-8859-1", "TRANSLIT", "trÄnslit", -1 }, ++ { "de_DE.ISO-8859-1", "TRANSLIT", "tr\xc4nslit", -1 }, + { "de_DE.UTF-8", "TRANSLIT", "translit", 0 }, +- { "de_DE.ISO-8859-1", "ä", "Ä", 1 } ++ { "de_DE.ISO-8859-1", "\xe4", "\xc4", 1 } + }; + #define ntests (sizeof (tests) / sizeof (tests[0])) + +diff --git a/localedata/tst-xlocale2.c b/localedata/tst-xlocale2.c +index 7f990501..3387d7f4 100644 +--- a/localedata/tst-xlocale2.c ++++ b/localedata/tst-xlocale2.c +@@ -36,7 +36,7 @@ main (void) + } + + +-static const char str[] = "0123456789abcdef ABCDEF ghijklmnopqrstuvwxyzäÄöÖüÜ"; ++static const char str[] = "0123456789abcdef ABCDEF ghijklmnopqrstuvwxyz\xe4\xc4\xf6\xd6\xfc\xdc"; + static const char exd[] = "11111111110000000000000000000000000000000000000000"; + static const char exa[] = "00000000001111110111111011111111111111111111111111"; + static const char exx[] = "11111111111111110111111000000000000000000000000000"; +-- +2.33.0 + diff --git a/backport-clang-0029-localedata-Fix-clang-warnings-on-tests.patch b/backport-clang-0029-localedata-Fix-clang-warnings-on-tests.patch new file mode 100644 index 0000000000000000000000000000000000000000..5bfdbd100a01c225916daaaaad4a30b630fb2242 --- /dev/null +++ b/backport-clang-0029-localedata-Fix-clang-warnings-on-tests.patch @@ -0,0 +1,39 @@ +From 38919f45b375b3467fa36aca824806bde2dcd133 Mon Sep 17 00:00:00 2001 +From: Adhemerval Zanella +Date: Tue, 15 Mar 2022 15:29:47 -0300 +Subject: [PATCH] localedata: Fix clang warnings on tests + +clang does not support 'I' specifier and handles it as a 'length +modifier'. +--- + localedata/tst-trans.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/localedata/tst-trans.c b/localedata/tst-trans.c +index 9b8ae646b9..2af4b3ed3b 100644 +--- a/localedata/tst-trans.c ++++ b/localedata/tst-trans.c +@@ -22,6 +22,7 @@ + #include + #include + #include ++#include + + static int + do_test (void) +@@ -59,7 +60,12 @@ do_test (void) + errors |= len != 10; + printf ("len = %d, wbuf = L\"%ls\"\n", len, wbuf); + +- snprintf (buf, sizeof buf, "%Id", 0x499602D2); ++ /* clang does not support 'I' specifier and handles it as a 'length ++ * modifier'. */ ++ DIAG_PUSH_NEEDS_COMMENT_CLANG; ++ DIAG_IGNORE_NEEDS_COMMENT_CLANG (16, "-Wformat"); ++ snprintf (buf, sizeof buf, "%Id", 0x499602D2U); ++ DIAG_POP_NEEDS_COMMENT_CLANG; + errors |= strcmp (buf, "bcdefghija") != 0; + len = strlen (buf); + errors |= len != 10; +-- +2.39.3 diff --git a/backport-clang-0030-Use-ffloat-store-iff-compiler-supports-it.patch b/backport-clang-0030-Use-ffloat-store-iff-compiler-supports-it.patch new file mode 100644 index 0000000000000000000000000000000000000000..82051844957649d7117eb6947dead1fdf1651751 --- /dev/null +++ b/backport-clang-0030-Use-ffloat-store-iff-compiler-supports-it.patch @@ -0,0 +1,91 @@ +From 8f5416d1a80cdb7901f8e793ae2933893518b4d8 Mon Sep 17 00:00:00 2001 +From: Adhemerval Zanella +Date: Thu, 24 Mar 2022 13:12:43 -0300 +Subject: [PATCH] Use -ffloat-store iff compiler supports it + +--- + configure | 24 ++++++++++++++++++++++++ + configure.ac | 10 ++++++++++ + math/Makefile | 4 ++-- + 3 files changed, 36 insertions(+), 2 deletions(-) + +diff --git a/configure b/configure +index 90c1f2ddaa..086eb8fda3 100755 +--- a/configure ++++ b/configure +@@ -7490,6 +7490,30 @@ printf "%s\n" "$libc_cv_cc_rounding_math" >&6; } + config_vars="$config_vars + config-cflags-frounding-math = $libc_cv_cc_rounding_math" + ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for compiler option that -ffloat-store" >&5 ++printf %s "checking for compiler option that -ffloat-store... " >&6; } ++if test ${libc_cv_cc_float_store+y} ++then : ++ printf %s "(cached) " >&6 ++else $as_nop ++ if { ac_try='${CC-cc} -Werror -ffloat-store -xc /dev/null -S -o /dev/null' ++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; } ++then : ++ libc_cv_cc_float_store=-ffloat-store ++else $as_nop ++ libc_cv_cc_float_store= ++fi ++ ++fi ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cc_float_store" >&5 ++printf "%s\n" "$libc_cv_cc_float_store" >&6; } ++config_vars="$config_vars ++config-cflags-float-store = $libc_cv_cc_float_store" ++ + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC accepts -fno-tree-loop-distribute-patterns with \ + __attribute__ ((__optimize__))" >&5 + printf %s "checking if $CC accepts -fno-tree-loop-distribute-patterns with \ +diff --git a/configure.ac b/configure.ac +index edf7c21a20..1467704750 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1543,6 +1543,16 @@ LIBC_TRY_CC_OPTION([-Werror -frounding-math], + LIBC_CONFIG_VAR([config-cflags-frounding-math], + [$libc_cv_cc_rounding_math]) + ++dnl Determine if compiler supports -ffloat-store ++AC_CACHE_CHECK([for compiler option that -ffloat-store], ++ libc_cv_cc_float_store, [dnl ++LIBC_TRY_CC_OPTION([-Werror -ffloat-store], ++ [libc_cv_cc_float_store=-ffloat-store], ++ [libc_cv_cc_float_store=]) ++]) ++LIBC_CONFIG_VAR([config-cflags-float-store], ++ [$libc_cv_cc_float_store]) ++ + AC_CACHE_CHECK(if $CC accepts -fno-tree-loop-distribute-patterns with \ + __attribute__ ((__optimize__)), libc_cv_cc_loop_to_function, [dnl + cat > conftest.c <3 million), so it may take a +-- +2.39.3 diff --git a/backport-clang-0031-math-Define-CMPLX-F-L-for-clang.patch b/backport-clang-0031-math-Define-CMPLX-F-L-for-clang.patch new file mode 100644 index 0000000000000000000000000000000000000000..5f591e37cbfb4ce90e426c9d92f3c18f3d232764 --- /dev/null +++ b/backport-clang-0031-math-Define-CMPLX-F-L-for-clang.patch @@ -0,0 +1,24 @@ +From 5029d36208aad358ef7b09d6cfc37d7f6df02ef4 Mon Sep 17 00:00:00 2001 +From: Adhemerval Zanella +Date: Thu, 24 Mar 2022 13:13:43 -0300 +Subject: [PATCH] math: Define CMPLX(F,L) for clang + +--- + math/complex.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/math/complex.h b/math/complex.h +index 0b943627d9..5fc03399d7 100644 +--- a/math/complex.h ++++ b/math/complex.h +@@ -52,7 +52,7 @@ __BEGIN_DECLS + #undef I + #define I _Complex_I + +-#if defined __USE_ISOC11 && __GNUC_PREREQ (4, 7) ++#if defined __USE_ISOC11 && (__GNUC_PREREQ (4, 7) || defined __clang__) + /* Macros to expand into expression of specified complex type. */ + # define CMPLX(x, y) __builtin_complex ((double) (x), (double) (y)) + # define CMPLXF(x, y) __builtin_complex ((float) (x), (float) (y)) +-- +2.39.3 diff --git a/backport-clang-0032-math-Only-build-tests-for-_Complex-__int128-iff-compiler.patch b/backport-clang-0032-math-Only-build-tests-for-_Complex-__int128-iff-compiler.patch new file mode 100644 index 0000000000000000000000000000000000000000..a9e15ed5833dcccae675fb6b2f00ff306161642a --- /dev/null +++ b/backport-clang-0032-math-Only-build-tests-for-_Complex-__int128-iff-compiler.patch @@ -0,0 +1,182 @@ +From 2959338459164054b596389a962225f446f0cf9d Mon Sep 17 00:00:00 2001 +From: Adhemerval Zanella +Date: Thu, 24 Mar 2022 14:24:08 -0300 +Subject: [PATCH] math: Only build tests for _Complex __int128 iff compiler + supports it + +clang fails building test-tgmath3-atan2.c: + + error: '_Complex __int128' is invalid + _Complex __int128 var__Complex___int128 __attribute__ ((unused)); + +since it does not support _Complex with __int128. So disable +the test in such case. +--- + configure | 29 +++++++++++++++++++++++++++++ + configure.ac | 17 +++++++++++++++++ + math/Makefile | 2 +- + math/gen-tgmath-tests.py | 38 +++++++++++++++++++++++++++++--------- + 4 files changed, 76 insertions(+), 10 deletions(-) + +diff --git a/configure b/configure +index 086eb8fda3..7605653d58 100755 +--- a/configure ++++ b/configure +@@ -7514,6 +7514,35 @@ printf "%s\n" "$libc_cv_cc_float_store" >&6; } + config_vars="$config_vars + config-cflags-float-store = $libc_cv_cc_float_store" + ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether compiler supports _Complex with __int128" >&5 ++printf %s "checking whether compiler supports _Complex with __int128... " >&6; } ++if test ${libc_cv_complex_int128+y} ++then : ++ printf %s "(cached) " >&6 ++else $as_nop ++ cat > conftest.c <&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; } ++then ++ libc_cv_complex_int128=yes ++fi ++rm -f conftest* ++fi ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_complex_int128" >&5 ++printf "%s\n" "$libc_cv_complex_int128" >&6; } ++config_vars="$config_vars ++config-complex-int128 = $libc_cv_complex_int128" ++ + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC accepts -fno-tree-loop-distribute-patterns with \ + __attribute__ ((__optimize__))" >&5 + printf %s "checking if $CC accepts -fno-tree-loop-distribute-patterns with \ +diff --git a/configure.ac b/configure.ac +index 1467704750..188aa8749f 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1553,6 +1553,23 @@ LIBC_TRY_CC_OPTION([-Werror -ffloat-store], + LIBC_CONFIG_VAR([config-cflags-float-store], + [$libc_cv_cc_float_store]) + ++AC_CACHE_CHECK([whether compiler supports _Complex with __int128], ++ [libc_cv_complex_int128], [dnl ++cat > conftest.c <&AS_MESSAGE_LOG_FD]) ++then ++ libc_cv_complex_int128=yes ++fi ++rm -f conftest*]) ++LIBC_CONFIG_VAR([config-complex-int128], ++ [$libc_cv_complex_int128]) ++ + AC_CACHE_CHECK(if $CC accepts -fno-tree-loop-distribute-patterns with \ + __attribute__ ((__optimize__)), libc_cv_cc_loop_to_function, [dnl + cat > conftest.c < $@ ++ $(PYTHON) gen-tgmath-tests.py --complex-int128 $(config-complex-int128) $* > $@ + + # Verify that the list of supported macros is in sync between the + # Makefile and gen-tgmath-tests.py. +diff --git a/math/gen-tgmath-tests.py b/math/gen-tgmath-tests.py +index 0882c7341a..e16ba0b0b0 100755 +--- a/math/gen-tgmath-tests.py ++++ b/math/gen-tgmath-tests.py +@@ -53,6 +53,7 @@ + # supported on any given configuration of glibc, the MANT_DIG value + # uniquely determines the format. + ++import argparse + import string + import sys + +@@ -182,7 +183,7 @@ class Type(object): + return self.name + + @staticmethod +- def init_types(): ++ def init_types(complex_int128): + """Initialize all the known types.""" + Type.create_type('_Float16', 'f16', 'FLT16_MANT_DIG', + complex_name='__CFLOAT16', +@@ -219,9 +220,11 @@ class Type(object): + Type.create_type('long long int', integer=True) + Type.create_type('unsigned long long int', integer=True) + Type.create_type('__int128', integer=True, +- condition='defined __SIZEOF_INT128__') ++ condition='defined __SIZEOF_INT128__', ++ complex_ok=complex_int128) + Type.create_type('unsigned __int128', integer=True, +- condition='defined __SIZEOF_INT128__') ++ condition='defined __SIZEOF_INT128__', ++ complex_ok=complex_int128) + Type.create_type('enum e', integer=True, complex_ok=False) + Type.create_type('_Bool', integer=True, complex_ok=False) + Type.create_type('bit_field', integer=True, complex_ok=False) +@@ -834,15 +837,32 @@ class Tests(object): + print('error: macro list mismatch') + sys.exit(1) + +-def main(): ++def get_parser(): ++ def strbool(string): ++ return True if string.lower() == 'yes' else False ++ ++ parser = argparse.ArgumentParser(description=__doc__) ++ parser.add_argument('--complex-int128', dest='complex_int128', ++ help='Generate tests for _Complex __int128', ++ type=strbool) ++ parser.add_argument('--check-list', action='store_true', ++ help='Verify that the list of supported macros') ++ parser.add_argument('macro', ++ help='macro to test', ++ nargs='*') ++ return parser ++ ++def main(argv): + """The main entry point.""" +- Type.init_types() ++ parser = get_parser() ++ opts = parser.parse_args(argv) ++ Type.init_types(True if opts.complex_int128 == 'yes' else False) + t = Tests() +- if sys.argv[1] == 'check-list': ++ if opts.check_list: + macro = None +- macro_list = sys.argv[2:] ++ macro_list = opts.macro + else: +- macro = sys.argv[1] ++ macro = opts.macro + macro_list = [] + t.add_all_tests(macro) + if macro: +@@ -851,4 +871,4 @@ def main(): + t.check_macro_list(macro_list) + + if __name__ == '__main__': +- main() ++ main(sys.argv[1:]) +-- +2.39.3 diff --git a/backport-clang-0033-stdlib-Avoid-internal-definitions-for-tst-strtod5i.patch b/backport-clang-0033-stdlib-Avoid-internal-definitions-for-tst-strtod5i.patch new file mode 100644 index 0000000000000000000000000000000000000000..23861395414c55ededf5917f579c5110b79a5ca6 --- /dev/null +++ b/backport-clang-0033-stdlib-Avoid-internal-definitions-for-tst-strtod5i.patch @@ -0,0 +1,24 @@ +From 9f21b11612318dc145196bc05dd22420849d60e4 Mon Sep 17 00:00:00 2001 +From: Adhemerval Zanella +Date: Thu, 24 Mar 2022 15:35:28 -0300 +Subject: [PATCH] stdlib: Avoid internal definitions for tst-strtod5i + +Compiler might emit a __copysign. +--- + stdlib/tst-strtod5i.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/stdlib/tst-strtod5i.c b/stdlib/tst-strtod5i.c +index c58c5b1439..3a3bb7df10 100644 +--- a/stdlib/tst-strtod5i.c ++++ b/stdlib/tst-strtod5i.c +@@ -16,6 +16,7 @@ + License along with the GNU C Library; if not, see + . */ + ++#define NO_MATH_REDIRECT + #include + #include + #include +-- +2.39.3 diff --git a/backport-clang-0034-stdio-Suppress-Z-format-for-clang.patch b/backport-clang-0034-stdio-Suppress-Z-format-for-clang.patch new file mode 100644 index 0000000000000000000000000000000000000000..e28c1a0ffcf2bdc997efa4693e488bab1e7a7386 --- /dev/null +++ b/backport-clang-0034-stdio-Suppress-Z-format-for-clang.patch @@ -0,0 +1,166 @@ +From b4d12698e4845f89a8c2a164df3259e56f47e1eb Mon Sep 17 00:00:00 2001 +From: Adhemerval Zanella +Date: Thu, 1 Sep 2022 09:29:23 -0300 +Subject: [PATCH] stdio: Suppress %Z format for clang + +clang does not handle %Z on print, and just suppressing +-Wformat-invalid-specifier might trigger another warning for extra +arguments (since %Z is ignored). So suppress -Wformat-extra-args +as well. + +For tst-fphex.c a heavy hammer is used since the printf is more +complex and clang thrown a more generic warning. +--- + stdio-common/bug1.c | 11 +++++++++++ + stdio-common/bug5.c | 6 ++++++ + stdio-common/test_rdwr.c | 7 +++++++ + stdio-common/tst-fphex.c | 5 +++++ + stdio-common/tstgetln.c | 6 ++++++ + 5 files changed, 35 insertions(+) + +diff --git a/stdio-common/bug1.c b/stdio-common/bug1.c +index 18e7d4c257..f23ee5b6bb 100644 +--- a/stdio-common/bug1.c ++++ b/stdio-common/bug1.c +@@ -1,6 +1,7 @@ + #include + #include + #include ++#include + + int + main (void) +@@ -13,12 +14,22 @@ main (void) + stream = open_memstream (&bp, &size); + fprintf (stream, "hello"); + fflush (stream); ++ /* clang do not handle %Z format. */ ++ DIAG_PUSH_NEEDS_COMMENT_CLANG; ++ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wformat-invalid-specifier"); ++ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wformat-extra-args"); + printf ("buf = %s, size = %Zu\n", bp, size); ++ DIAG_POP_NEEDS_COMMENT_CLANG; + lose |= size != 5; + lose |= strncmp (bp, "hello", size); + fprintf (stream, ", world"); + fclose (stream); ++ /* clang do not handle %Z format. */ ++ DIAG_PUSH_NEEDS_COMMENT_CLANG; ++ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wformat-invalid-specifier"); ++ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wformat-extra-args"); + printf ("buf = %s, size = %Zu\n", bp, size); ++ DIAG_POP_NEEDS_COMMENT_CLANG; + lose |= size != 12; + lose |= strncmp (bp, "hello, world", 12); + +diff --git a/stdio-common/bug5.c b/stdio-common/bug5.c +index dfa19aed55..c46810f94c 100644 +--- a/stdio-common/bug5.c ++++ b/stdio-common/bug5.c +@@ -6,6 +6,7 @@ + #include + #include + #include ++#include + + #include + +@@ -30,7 +31,12 @@ main (void) + return 1; + } + for (i = 0; i < 1000; ++i) ++ /* clang do not handle %Z format. */ ++ DIAG_PUSH_NEEDS_COMMENT_CLANG; ++ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wformat-invalid-specifier"); ++ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wformat-extra-args"); + fprintf (in, "%Zu\n", i); ++ DIAG_POP_NEEDS_COMMENT_CLANG; + + out = fopen (outname, "w"); + if (out == NULL) +diff --git a/stdio-common/test_rdwr.c b/stdio-common/test_rdwr.c +index 0544916eb1..8783f53b35 100644 +--- a/stdio-common/test_rdwr.c ++++ b/stdio-common/test_rdwr.c +@@ -19,6 +19,7 @@ + #include + #include + #include ++#include + + #include + +@@ -54,6 +55,11 @@ main (int argc, char **argv) + rewind (f); + (void) fputs (buf, f); + rewind (f); ++ ++ /* clang do not handle %Z format. */ ++ DIAG_PUSH_NEEDS_COMMENT_CLANG; ++ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wformat-invalid-specifier"); ++ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wformat-extra-args"); + { + size_t i; + for (i = 0; i < replace_from; ++i) +@@ -101,6 +107,7 @@ main (int argc, char **argv) + lose = 1; + } + } ++ DIAG_POP_NEEDS_COMMENT_CLANG; + + if (!lose) + { +diff --git a/stdio-common/tst-fphex.c b/stdio-common/tst-fphex.c +index efba482537..7c0e4bd6fc 100644 +--- a/stdio-common/tst-fphex.c ++++ b/stdio-common/tst-fphex.c +@@ -3,6 +3,7 @@ + #include + #include + #include ++#include + + #ifndef WIDE + # define STR_LEN strlen +@@ -56,10 +57,14 @@ do_test (void) + int n = SPRINT (buf, array_length (buf), t->fmt, t->value); + if (n != STR_LEN (t->expect) || STR_CMP (buf, t->expect) != 0) + { ++ /* clang do not handle %Z format. */ ++ DIAG_PUSH_NEEDS_COMMENT_CLANG; ++ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wformat"); + PRINT (L_("" S "\tExpected \"" S "\" (%Zu)\n\tGot \"" + S "\" (%d, %Zu)\n"), + t->fmt, t->expect, STR_LEN (t->expect), + buf, n, STR_LEN (buf)); ++ DIAG_POP_NEEDS_COMMENT_CLANG; + result = 1; + } + } +diff --git a/stdio-common/tstgetln.c b/stdio-common/tstgetln.c +index 8c633cf455..f409597c94 100644 +--- a/stdio-common/tstgetln.c ++++ b/stdio-common/tstgetln.c +@@ -16,6 +16,7 @@ + . */ + + #include ++#include + + int + main (int argc, char *argv[]) +@@ -26,7 +27,12 @@ main (int argc, char *argv[]) + + while ((len = getline (&buf, &size, stdin)) != -1) + { ++ /* clang do not handle %Z format. */ ++ DIAG_PUSH_NEEDS_COMMENT_CLANG; ++ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wformat-invalid-specifier"); ++ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wformat-extra-args"); + printf ("bufsize %Zu; read %Zd: ", size, len); ++ DIAG_POP_NEEDS_COMMENT_CLANG; + if (fwrite (buf, len, 1, stdout) != 1) + { + perror ("fwrite"); +-- +2.39.3 diff --git a/backport-clang-0035-stdio-Disable-bug23-3-on-clang.patch b/backport-clang-0035-stdio-Disable-bug23-3-on-clang.patch new file mode 100644 index 0000000000000000000000000000000000000000..e8e71811b524d3f8eade6e9d3a0df5d124928200 --- /dev/null +++ b/backport-clang-0035-stdio-Disable-bug23-3-on-clang.patch @@ -0,0 +1,34 @@ +From 152e593488247479364ef469a4a4d5ac5de42d70 Mon Sep 17 00:00:00 2001 +From: Adhemerval Zanella +Date: Thu, 24 Mar 2022 15:45:46 -0300 +Subject: [PATCH] stdio: Disable bug23-3 on clang + +--- + stdio-common/bug28.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/stdio-common/bug28.c b/stdio-common/bug28.c +index 57c8cef195..a716299650 100644 +--- a/stdio-common/bug28.c ++++ b/stdio-common/bug28.c +@@ -5,6 +5,10 @@ + int + do_test (void) + { ++#ifdef __clang__ ++ /* It triggers an infinite loop on clang. */ ++ return 77; ++#else + size_t instances = 16384; + #define X0 "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d" + const char *item = "\na\nabbcd55"; +@@ -45,6 +49,7 @@ do_test (void) + } + free (buf); + return 0; ++#endif + } + #define TEST_FUNCTION do_test () + #include "../test-skeleton.c" +-- +2.39.3 diff --git a/backport-clang-0036-stdio-Disable-clang-warning-on-scanf13-test.patch b/backport-clang-0036-stdio-Disable-clang-warning-on-scanf13-test.patch new file mode 100644 index 0000000000000000000000000000000000000000..31bc7019c4f9e819c575689eb083c9f500f1a436 --- /dev/null +++ b/backport-clang-0036-stdio-Disable-clang-warning-on-scanf13-test.patch @@ -0,0 +1,79 @@ +From 6d41bd98ff681e3b051b79626d1a9b86ac1fe46e Mon Sep 17 00:00:00 2001 +From: Adhemerval Zanella +Date: Thu, 24 Mar 2022 15:46:34 -0300 +Subject: [PATCH] stdio: Disable clang warning on scanf13 test + +--- + stdio-common/scanf13.c | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +diff --git a/stdio-common/scanf13.c b/stdio-common/scanf13.c +index 60aa62a26f..6f3ddfa1e0 100644 +--- a/stdio-common/scanf13.c ++++ b/stdio-common/scanf13.c +@@ -3,6 +3,7 @@ + #include + #include + #include ++#include + + int + main (void) +@@ -20,6 +21,11 @@ main (void) + } while (0) + + setlocale (LC_ALL, "de_DE.UTF-8"); ++ /* TODO: explain why clang need these. */ ++ DIAG_PUSH_NEEDS_COMMENT_CLANG; ++ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wformat-invalid-specifier"); ++ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wformat-extra-args"); ++ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wfortify-source"); + if (sscanf ("A \xc3\x84-\t\t\xc3\x84-abcdefbcd\t\xc3\x84-B", + "A%ms%10ms%4m[bcd]%4mcB", &sp1, &sp2, &sp3, &sp4) != 4) + FAIL (); +@@ -57,6 +63,7 @@ main (void) + FAIL (); + free (lsp4); + } ++ DIAG_POP_NEEDS_COMMENT_CLANG; + + memset (buf, '/', sizeof (buf)); + buf[0] = '\t'; +@@ -86,6 +93,9 @@ main (void) + FAIL (); + free (sp2); + } ++ /* TODO: explain why clang need these. */ ++ DIAG_PUSH_NEEDS_COMMENT_CLANG; ++ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wfortify-source"); + if (sscanf (buf, "%2048ms%mc", &sp3, &sp4) != 2) + FAIL (); + else +@@ -126,6 +136,7 @@ main (void) + FAIL (); + free (sp4); + } ++ DIAG_POP_NEEDS_COMMENT_CLANG; + if (sscanf (buf, "%mS%mC", &lsp1, &lsp2) != 2) + FAIL (); + else +@@ -142,6 +153,9 @@ main (void) + FAIL (); + free (lsp2); + } ++ DIAG_PUSH_NEEDS_COMMENT_CLANG; ++ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wformat-invalid-specifier"); ++ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wformat-extra-args"); + if (sscanf (buf, "%2048mls%mlc", &lsp3, &lsp4) != 2) + FAIL (); + else +@@ -182,6 +196,7 @@ main (void) + FAIL (); + free (lsp4); + } ++ DIAG_POP_NEEDS_COMMENT_CLANG; + + return result; + } +-- +2.39.3 diff --git a/backport-clang-0037-stdio-Fix-clang-warnings-on-tests.patch b/backport-clang-0037-stdio-Fix-clang-warnings-on-tests.patch new file mode 100644 index 0000000000000000000000000000000000000000..8b4d6051983bdee76b3fe6a03f8135b6a87dd490 --- /dev/null +++ b/backport-clang-0037-stdio-Fix-clang-warnings-on-tests.patch @@ -0,0 +1,37 @@ +From 004d3b3617451b7ba264a23a0ea95502e58cfa0b Mon Sep 17 00:00:00 2001 +From: Adhemerval Zanella +Date: Thu, 27 Jul 2023 15:27:08 -0300 +Subject: [PATCH] stdio: Fix clang warnings on tests + +clang does not support 'I' specifier and handles it as a 'length +modifier'. +--- + stdio-common/tst-scanf-to_inpunct.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/stdio-common/tst-scanf-to_inpunct.c b/stdio-common/tst-scanf-to_inpunct.c +index 32236ac2dc..69508f26d7 100644 +--- a/stdio-common/tst-scanf-to_inpunct.c ++++ b/stdio-common/tst-scanf-to_inpunct.c +@@ -18,6 +18,7 @@ + . */ + + #include ++#include + #include + #include + #include +@@ -68,7 +69,11 @@ do_test (void) + for (int i = 0; i < array_length (inputs); i++) + { + int n; ++ /* clang does not support 'I' specifier. */ ++ DIAG_PUSH_NEEDS_COMMENT_CLANG; ++ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wformat"); + sscanf (inputs[i].str, "%Id", &n); ++ DIAG_POP_NEEDS_COMMENT_CLANG; + TEST_COMPARE (n, inputs[i].n); + } + +-- +2.39.3 diff --git a/backport-clang-0038-stdio-Suppress-Wformat-only-for-gcc-for-tst-sprintf-errno-c.patch b/backport-clang-0038-stdio-Suppress-Wformat-only-for-gcc-for-tst-sprintf-errno-c.patch new file mode 100644 index 0000000000000000000000000000000000000000..f6119821be969671a796be4bb16dada0459d3918 --- /dev/null +++ b/backport-clang-0038-stdio-Suppress-Wformat-only-for-gcc-for-tst-sprintf-errno-c.patch @@ -0,0 +1,24 @@ +From e1a99a4dcd7a35ae64622b31310ea6f274a2ccd3 Mon Sep 17 00:00:00 2001 +From: Adhemerval Zanella +Date: Thu, 24 Mar 2022 15:56:35 -0300 +Subject: [PATCH] stdio: Suppress -Wformat only for gcc for tst-sprintf-errno.c + +--- + stdio-common/tst-sprintf-errno.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/stdio-common/tst-sprintf-errno.c b/stdio-common/tst-sprintf-errno.c +index 79764d7a5f..bc9485f6f5 100644 +--- a/stdio-common/tst-sprintf-errno.c ++++ b/stdio-common/tst-sprintf-errno.c +@@ -24,7 +24,7 @@ + + /* GCC does not yet know about the %#m specifier. */ + DIAG_PUSH_NEEDS_COMMENT; +-DIAG_IGNORE_NEEDS_COMMENT (11, "-Wformat="); ++DIAG_IGNORE_NEEDS_COMMENT_GCC (11, "-Wformat="); + + static int + do_test (void) +-- +2.39.3 diff --git a/backport-clang-0039-stdio-Suppress-clang-warnings-for-tst-unlockedio-c.patch b/backport-clang-0039-stdio-Suppress-clang-warnings-for-tst-unlockedio-c.patch new file mode 100644 index 0000000000000000000000000000000000000000..5da36b76f0528d6ae7f1a6bd5caeb2aba01e5df6 --- /dev/null +++ b/backport-clang-0039-stdio-Suppress-clang-warnings-for-tst-unlockedio-c.patch @@ -0,0 +1,65 @@ +From e2291b785395f383da63feec174c4dd274868a38 Mon Sep 17 00:00:00 2001 +From: Adhemerval Zanella +Date: Thu, 24 Mar 2022 16:03:16 -0300 +Subject: [PATCH] stdio: Suppress clang warnings for tst-unlockedio.c + +Clang issues the following warnings: + + tst-unlockedio.c:63:36: error: implicit conversion from 'double' to + 'size_t' (aka 'unsigned long') changes value from -0 to 0 + [-Werror,-Wliteral-conversion] + || fwrite_unlocked (blah, 0, -0.0, fp) != 0 + ~~~~~~~~~~~~~~~ ^~~~ + tst-unlockedio.c:61:33: error: implicit conversion from 'double' to + 'size_t' (aka 'unsigned long') changes value from 0.25 to 0 + [-Werror,-Wliteral-conversion] + || fwrite_unlocked (--cp, 0.25, 16, fp) != 0 + ~~~~~~~~~~~~~~~ ^~~~ + tst-unlockedio.c:59:37: error: implicit conversion from 'double' to + 'size_t' (aka 'unsigned long') changes value from 0.25 to 0 + [-Werror,-Wliteral-conversion] + || fwrite_unlocked (cp++, 16, 0.25, fp) != 0 + ~~~~~~~~~~~~~~~ ^~~~ + tst-unlockedio.c:116:34: error: implicit conversion from 'double' to + 'size_t' (aka 'unsigned long') changes value from -0 to 0 + [-Werror,-Wliteral-conversion] + || fread_unlocked (buf, 0, -0.0, fp) != 0 + ~~~~~~~~~~~~~~ ^~~~ + tst-unlockedio.c:114:32: error: implicit conversion from 'double' to + 'size_t' (aka 'unsigned long') changes value from 0.25 to 0 + [-Werror,-Wliteral-conversion] + || fread_unlocked (--wp, 0.25, 16, fp) != 0 + ~~~~~~~~~~~~~~ ^~~~ + tst-unlockedio.c:112:36: error: implicit conversion from 'double' to + 'size_t' (aka 'unsigned long') changes value from 0.25 to 0 + [-Werror,-Wliteral-conversion] + || fread_unlocked (wp++, 16, 0.25, fp) != 0 + ~~~~~~~~~~~~~~ ^~~~ +--- + stdio-common/tst-unlockedio.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/stdio-common/tst-unlockedio.c b/stdio-common/tst-unlockedio.c +index 67a7d621f5..c9c55fdad2 100644 +--- a/stdio-common/tst-unlockedio.c ++++ b/stdio-common/tst-unlockedio.c +@@ -51,6 +51,9 @@ do_test (void) + fread_unlocked below as well. */ + DIAG_PUSH_NEEDS_COMMENT; + DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wdiv-by-zero"); ++ /* clang warns about the implicit conversion from double to size_t, ++ which is required by this tests. */ ++ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wliteral-conversion"); + if (ftello (fp) != 0 + || fwrite_unlocked (blah, blah - blah, strlen (blah), f++) != 0 + || f != fp + 1 +@@ -104,6 +107,7 @@ do_test (void) + /* See explanation above. */ + DIAG_PUSH_NEEDS_COMMENT; + DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wdiv-by-zero"); ++ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wliteral-conversion"); + if (ftello (fp) != 0 + || fread_unlocked (buf, buf - buf, strlen (blah), f++) != 0 + || f != fp + 1 +-- +2.39.3 diff --git a/backport-clang-0040-stdio-Suppress-clang-warnings-for-tst-vprintf-width-i18n-c.patch b/backport-clang-0040-stdio-Suppress-clang-warnings-for-tst-vprintf-width-i18n-c.patch new file mode 100644 index 0000000000000000000000000000000000000000..dabab8da9cb8a52a91827f55dc2afa2600416f15 --- /dev/null +++ b/backport-clang-0040-stdio-Suppress-clang-warnings-for-tst-vprintf-width-i18n-c.patch @@ -0,0 +1,66 @@ +From 09c3225001d42e2cdd63207cafa92e22756d502b Mon Sep 17 00:00:00 2001 +From: Adhemerval Zanella +Date: Fri, 3 Jun 2022 10:43:42 -0300 +Subject: [PATCH] stdio: Suppress clang warnings for tst-vprintf-width-i18n.c + +Clang issues the following warning: + + tst-vfprintf-width-i18n.c:51:34: error: invalid conversion specifier '1' + [-Werror,-Wformat-invalid-specifier] + TEST_COMPARE (sprintf (buf, "%I16d", 12345), 16); + ~~^ + +Since it does not how to handle %I. +--- + stdio-common/tst-vfprintf-width-i18n.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/stdio-common/tst-vfprintf-width-i18n.c b/stdio-common/tst-vfprintf-width-i18n.c +index 6d5a5f8a59..b9c0a16c63 100644 +--- a/stdio-common/tst-vfprintf-width-i18n.c ++++ b/stdio-common/tst-vfprintf-width-i18n.c +@@ -23,6 +23,7 @@ + #include + #include + #include ++#include + + static int + do_test (void) +@@ -48,6 +49,9 @@ do_test (void) + TEST_COMPARE_STRING (buf, " INR12,345.67"); + + /* Translated. */ ++ /* clang does not know about the GNU extension 'I'. */ ++ DIAG_PUSH_NEEDS_COMMENT_CLANG; ++ DIAG_IGNORE_NEEDS_COMMENT_CLANG (14, "-Wformat-invalid-specifier"); + TEST_COMPARE (sprintf (buf, "%I16d", 12345), 16); + TEST_COMPARE_STRING (buf, " १२३४५"); + TEST_COMPARE (sprintf (buf, "%I12.2f", 12345.67), 26); +@@ -58,6 +62,7 @@ do_test (void) + TEST_COMPARE_STRING (buf, " १२,३४५"); + TEST_COMPARE (sprintf (buf, "%'I12.2f", 12345.67), 26); + TEST_COMPARE_STRING (buf, " १२,३४५.६७"); ++ DIAG_POP_NEEDS_COMMENT_CLANG; + + xsetlocale (LC_ALL, "ps_AF.UTF-8"); + +@@ -78,6 +83,8 @@ do_test (void) + TEST_COMPARE_STRING (buf, " 12Ù¬346 AFN"); /* Counts bytes. */ + + /* Translated. */ ++ DIAG_PUSH_NEEDS_COMMENT_CLANG; ++ DIAG_IGNORE_NEEDS_COMMENT_CLANG (14, "-Wformat-invalid-specifier"); + TEST_COMPARE (sprintf (buf, "%I11d", 12345), 11); + TEST_COMPARE_STRING (buf, " ١٢٣۴٥"); + TEST_COMPARE (sprintf (buf, "%I12.2f", 12345.67), 20); +@@ -88,6 +95,7 @@ do_test (void) + TEST_COMPARE_STRING (buf, " ١٢٬٣۴٥"); + TEST_COMPARE (sprintf (buf, "%'I12.2f", 12345.67), 21); + TEST_COMPARE_STRING (buf, " ١٢٬٣۴٥٫٦٧"); ++ DIAG_POP_NEEDS_COMMENT_CLANG; + + return 0; + } +-- +2.39.3 diff --git a/backport-clang-0041-Handle-pragma-GCC-optimize-for-clang.patch b/backport-clang-0041-Handle-pragma-GCC-optimize-for-clang.patch new file mode 100644 index 0000000000000000000000000000000000000000..e9b8537799f0b5276e0861db768c99a8ad6d989d --- /dev/null +++ b/backport-clang-0041-Handle-pragma-GCC-optimize-for-clang.patch @@ -0,0 +1,64 @@ +From 4da53696a28ec5e8c931124316991e644040472e Mon Sep 17 00:00:00 2001 +From: Adhemerval Zanella +Date: Thu, 24 Mar 2022 16:17:59 -0300 +Subject: [PATCH] Handle pragma GCC optimize for clang + +--- + libio/tst-bz24051.c | 6 +++++- + libio/tst-bz24153.c | 6 +++++- + malloc/tst-tcfree3.c | 6 +++++- + 3 files changed, 15 insertions(+), 3 deletions(-) + +diff --git a/libio/tst-bz24051.c b/libio/tst-bz24051.c +index b2610827a0..a9053c0dca 100644 +--- a/libio/tst-bz24051.c ++++ b/libio/tst-bz24051.c +@@ -19,7 +19,11 @@ + + /* Prevent putchar -> _IO_putc inline expansion. */ + #define __NO_INLINE__ +-#pragma GCC optimize("O0") ++#ifdef __clang__ ++# pragma clang optimize off ++#else ++# pragma GCC optimize("O0") ++#endif + + #include + #include +diff --git a/libio/tst-bz24153.c b/libio/tst-bz24153.c +index 88f7ab13eb..37e0a250bd 100644 +--- a/libio/tst-bz24153.c ++++ b/libio/tst-bz24153.c +@@ -18,7 +18,11 @@ + + /* Prevent getchar -> getc inline expansion. */ + #define __NO_INLINE__ +-#pragma GCC optimize ("O0") ++#ifdef __clang__ ++# pragma clang optimize off ++#else ++# pragma GCC optimize("O0") ++#endif + + #include + #include +diff --git a/malloc/tst-tcfree3.c b/malloc/tst-tcfree3.c +index ce6d958f8a..dbee260322 100644 +--- a/malloc/tst-tcfree3.c ++++ b/malloc/tst-tcfree3.c +@@ -20,7 +20,11 @@ + #include + + /* Prevent GCC from optimizing away any malloc/free pairs. */ +-#pragma GCC optimize ("O0") ++#ifdef __clang__ ++# pragma clang optimize off ++#else ++# pragma GCC optimize("O0") ++#endif + + static int + do_test (void) +-- +2.39.3 diff --git a/backport-clang-0042-Use-check-tests-with-trampolines-iff-compiler-supports-it.patch b/backport-clang-0042-Use-check-tests-with-trampolines-iff-compiler-supports-it.patch new file mode 100644 index 0000000000000000000000000000000000000000..4fce6dc3ca1fda249647b207a4fd4fd097b826c6 --- /dev/null +++ b/backport-clang-0042-Use-check-tests-with-trampolines-iff-compiler-supports-it.patch @@ -0,0 +1,171 @@ +From 3fc760aaca630876f44cdc6368f359c96f8de4ba Mon Sep 17 00:00:00 2001 +From: Adhemerval Zanella +Date: Fri, 25 Mar 2022 08:58:03 -0300 +Subject: [PATCH] Use check tests with trampolines iff compiler supports it + +--- + configure | 33 +++++++++++++++++++++++++++++++++ + configure.ac | 20 ++++++++++++++++++++ + elf/Makefile | 10 +++++----- + nptl/Makefile | 8 ++++++-- + 4 files changed, 64 insertions(+), 7 deletions(-) + +diff --git a/configure b/configure +index 7605653d58..289d1efdaa 100755 +--- a/configure ++++ b/configure +@@ -7576,6 +7576,39 @@ if test $libc_cv_cc_loop_to_function = yes; then + fi + + ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC has support for trampolines" >&5 ++printf %s "checking if $CC has support for trampolines... " >&6; } ++if test ${libc_cv_cc_trampoline+y} ++then : ++ printf %s "(cached) " >&6 ++else $as_nop ++ cat > conftest.c <&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; } ++then ++ libc_cv_cc_trampoline=yes ++fi ++rm -f conftest* ++fi ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cc_trampoline" >&5 ++printf "%s\n" "$libc_cv_cc_trampoline" >&6; } ++config_vars="$config_vars ++have-cc-trampoline = $libc_cv_cc_trampoline" ++ + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libgd" >&5 + printf %s "checking for libgd... " >&6; } + if test "$with_gd" != "no"; then +diff --git a/configure.ac b/configure.ac +index 188aa8749f..b7ae62ce6f 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1588,6 +1588,26 @@ if test $libc_cv_cc_loop_to_function = yes; then + fi + AC_SUBST(libc_cv_cc_loop_to_function) + ++AC_CACHE_CHECK(if $CC has support for trampolines, libc_cv_cc_trampoline, [dnl ++cat > conftest.c < /dev/null) + + ifneq ($(selinux-enabled),1) +-tests-execstack-yes = \ ++tests-execstack-yesyes = \ + tst-execstack \ + tst-execstack-needed \ + tst-execstack-prog \ +@@ -607,7 +607,7 @@ $(objpfx)tst-valgrind-smoke.out: tst-valgrind-smoke.sh $(objpfx)ld.so $(objpfx)v + $(SHELL) $< $(objpfx)ld.so $(rtlddir)/$(rtld-installed-name) '$(test-wrapper-env)' \ + '$(run-program-env)' '$(rpath-link)' $(objpfx)valgrind-test > $@; $(evaluate-test) + +-tests += $(tests-execstack-$(have-z-execstack)) ++tests += $(tests-execstack-$(have-z-execstack)$(have-cc-trampoline)) + ifeq ($(run-built-tests),yes) + tests-special += \ + $(objpfx)noload-mem.out \ +@@ -962,7 +962,7 @@ modules-names-cxx = \ + + modules-names += \ + $(if $(CXX),$(modules-names-cxx)) \ +- $(modules-execstack-$(have-z-execstack)) \ ++ $(modules-execstack-$(have-z-execstack)$(have-cc-trampoline)) \ + $(tlsmod17a-modules) \ + $(tlsmod18a-modules) \ + $(tst-tls-many-dynamic-modules) \ +@@ -1011,7 +1011,7 @@ tests-pie += vismain + tst-dlopen-self-pie + tests-pie += tst-pie1 tst-pie2 tst-dlopen-tlsmodid-pie tst-dlopen-self-pie + endif +-modules-execstack-yes = tst-execstack-mod ++modules-execstack-yesyes = tst-execstack-mod + extra-test-objs += $(addsuffix .os,$(strip $(modules-names))) + + # filtmod1.so, tst-big-note-lib.so, tst-ro-dynamic-mod.so have special +@@ -1816,7 +1816,7 @@ $(objpfx)unload8.out: $(objpfx)unload8mod1.so $(objpfx)unload8mod1x.so + + $(objpfx)tst-tls9-static.out: $(objpfx)tst-tlsmod5.so $(objpfx)tst-tlsmod6.so + +-ifeq ($(have-z-execstack),yes) ++ifeq ($(have-z-execstack)$(have-cc-trampoline),yesyes) + $(objpfx)tst-execstack.out: $(objpfx)tst-execstack-mod.so + CPPFLAGS-tst-execstack.c += -DUSE_PTHREADS=0 + LDFLAGS-tst-execstack = -Wl,-z,noexecstack +diff --git a/nptl/Makefile b/nptl/Makefile +index ffa5722e48..d0b1510e63 100644 +--- a/nptl/Makefile ++++ b/nptl/Makefile +@@ -465,7 +465,7 @@ tests-internal += \ + tst-tls3-malloc \ + tst-tls5 \ + # tests-internal +-ifeq ($(have-z-execstack),yes) ++ifeq ($(have-z-execstack)$(have-cc-trampoline),yesyes) + tests += tst-execstack + endif + endif +@@ -474,7 +474,6 @@ modules-names = \ + tst-audit-threads-mod1 \ + tst-audit-threads-mod2 \ + tst-compat-forwarder-mod \ +- tst-execstack-mod \ + tst-stack4mod \ + tst-tls3mod \ + tst-tls5mod \ +@@ -485,6 +484,11 @@ modules-names = \ + tst-tls5mode \ + tst-tls5modf \ + # modules-names ++ifeq ($(have-z-execstack)$(have-cc-trampoline),yesyes) ++modules-names += \ ++ tst-execstack-mod ++ # modules-names ++endif + extra-test-objs += \ + $(addsuffix .os,$(strip $(modules-names))) \ + tst-cleanup4aux.o \ +-- +2.39.3 diff --git a/backport-clang-0043-malloc-Suppress-clang-warning-on-tst-memalign.patch b/backport-clang-0043-malloc-Suppress-clang-warning-on-tst-memalign.patch new file mode 100644 index 0000000000000000000000000000000000000000..9373cd9c5ff29ca94506b324383f20f858cbe5c6 --- /dev/null +++ b/backport-clang-0043-malloc-Suppress-clang-warning-on-tst-memalign.patch @@ -0,0 +1,27 @@ +From 32c3c6888b828d4605450fc09e249374fffff3eb Mon Sep 17 00:00:00 2001 +From: Adhemerval Zanella +Date: Fri, 25 Mar 2022 09:00:43 -0300 +Subject: [PATCH] malloc: Suppress clang warning on tst-memalign + +--- + malloc/tst-memalign.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/malloc/tst-memalign.c b/malloc/tst-memalign.c +index 3b370e4ff7..720e640f16 100644 +--- a/malloc/tst-memalign.c ++++ b/malloc/tst-memalign.c +@@ -83,7 +83,11 @@ do_test (void) + errno = 0; + + /* Test to expose integer overflow in malloc internals from BZ #16038. */ ++ DIAG_PUSH_NEEDS_COMMENT_CLANG; ++ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wnon-power-of-two-alignment"); ++ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wbuiltin-assume-aligned-alignment"); + p = memalign (-1, pagesize); ++ DIAG_POP_NEEDS_COMMENT_CLANG; + + save = errno; + +-- +2.39.3 diff --git a/backport-clang-0044-malloc-Suppress-clang-warning-on-tst-aligned-alloc.patch b/backport-clang-0044-malloc-Suppress-clang-warning-on-tst-aligned-alloc.patch new file mode 100644 index 0000000000000000000000000000000000000000..a7041f04371eaa408f4f7712c21efbfa8de63cf4 --- /dev/null +++ b/backport-clang-0044-malloc-Suppress-clang-warning-on-tst-aligned-alloc.patch @@ -0,0 +1,47 @@ +From cb40ee75995a53b234b3e5c613d4f8a6db002e0b Mon Sep 17 00:00:00 2001 +From: Adhemerval Zanella +Date: Thu, 27 Jul 2023 15:55:42 -0300 +Subject: [PATCH] malloc: Suppress clang warning on tst-aligned-alloc + +--- + malloc/tst-aligned-alloc.c | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +diff --git a/malloc/tst-aligned-alloc.c b/malloc/tst-aligned-alloc.c +index 8bd6527147..23616dfa5b 100644 +--- a/malloc/tst-aligned-alloc.c ++++ b/malloc/tst-aligned-alloc.c +@@ -55,18 +55,31 @@ do_test (void) + if (p2 == NULL) + FAIL_EXIT1 ("aligned_alloc(1, 64) failed"); + ++ /* clang warns that alignment is not a power of 2, which is what the ++ test means to do. */ ++ DIAG_PUSH_NEEDS_COMMENT_CLANG; ++ DIAG_IGNORE_NEEDS_COMMENT_CLANG (18.0, "-Wnon-power-of-two-alignment"); + p3 = aligned_alloc (65, 64); ++ DIAG_POP_NEEDS_COMMENT_CLANG; + + if (p3 != NULL) + FAIL_EXIT1 ("aligned_alloc(65, 64) did not fail"); + ++ DIAG_PUSH_NEEDS_COMMENT_CLANG; ++ DIAG_IGNORE_NEEDS_COMMENT_CLANG (18.0, "-Wnon-power-of-two-alignment"); + p4 = aligned_alloc (0, 64); ++ DIAG_POP_NEEDS_COMMENT_CLANG; + + if (p4 != NULL) + FAIL_EXIT1 ("aligned_alloc(0, 64) did not fail"); + ++ /* clang warns that alignment must be 4294967296 or smaller, which is ++ what the test means to do. */ ++ DIAG_PUSH_NEEDS_COMMENT_CLANG; ++ DIAG_IGNORE_NEEDS_COMMENT_CLANG (18.0, "-Wbuiltin-assume-aligned-alignment"); + /* This is an alignment like 0x80000000...UL */ + p5 = aligned_alloc (SIZE_MAX / 2 + 1, 64); ++ DIAG_POP_NEEDS_COMMENT_CLANG; + + if (p5 != NULL) + FAIL_EXIT1 ("aligned_alloc(SIZE_MAX/2+1, 64) did not fail"); +-- +2.39.3 diff --git a/backport-clang-0045-string-Suppress-clang-Wsuspicious-bzero-on-tester.patch b/backport-clang-0045-string-Suppress-clang-Wsuspicious-bzero-on-tester.patch new file mode 100644 index 0000000000000000000000000000000000000000..8ab6326de032775fbd60bc499bf7839aa822449f --- /dev/null +++ b/backport-clang-0045-string-Suppress-clang-Wsuspicious-bzero-on-tester.patch @@ -0,0 +1,90 @@ +From 29ddc1b92bd724f1f117941c0613840eb1c985f0 Mon Sep 17 00:00:00 2001 +From: Adhemerval Zanella +Date: Thu, 24 Mar 2022 18:08:41 -0300 +Subject: [PATCH] string: Suppress clang -Wsuspicious-bzero on tester + +--- + string/tester.c | 26 ++++++++++++++++++++++++++ + 1 file changed, 26 insertions(+) + +diff --git a/string/tester.c b/string/tester.c +index 824cf315ff..1c1bed1296 100644 +--- a/string/tester.c ++++ b/string/tester.c +@@ -380,11 +380,19 @@ test_strncat (void) + mechanism. */ + it = "strncat"; + (void) strcpy (one, "ijk"); ++ /* clang complains that size argument is too large for the destination ++ buffer. */ ++ DIAG_PUSH_NEEDS_COMMENT_CLANG; ++ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wfortify-source"); + check (strncat (one, "lmn", 99) == one, 1); /* Returned value. */ ++ DIAG_POP_NEEDS_COMMENT_CLANG; + equal (one, "ijklmn", 2); /* Basic test. */ + + (void) strcpy (one, "x"); ++ DIAG_PUSH_NEEDS_COMMENT_CLANG; ++ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wfortify-source"); + (void) strncat (one, "yz", 99); ++ DIAG_POP_NEEDS_COMMENT_CLANG; + equal (one, "xyz", 3); /* Writeover. */ + equal (one+4, "mn", 4); /* Wrote too much? */ + +@@ -397,6 +405,7 @@ test_strncat (void) + GCC 7 or newer. */ + #if __GNUC_PREREQ (7, 0) + (void) strncat (one, two, 99); ++ DIAG_POP_NEEDS_COMMENT_CLANG; + equal (one, "ghef", 5); /* Basic test encore. */ + #else + equal (one, "gh", 2); +@@ -404,13 +413,22 @@ test_strncat (void) + equal (two, "ef", 6); /* Stomped on source? */ + + (void) strcpy (one, ""); ++ DIAG_PUSH_NEEDS_COMMENT_CLANG; ++ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wfortify-source"); + (void) strncat (one, "", 99); ++ DIAG_POP_NEEDS_COMMENT_CLANG; + equal (one, "", 7); /* Boundary conditions. */ + (void) strcpy (one, "ab"); ++ DIAG_PUSH_NEEDS_COMMENT_CLANG; ++ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wfortify-source"); + (void) strncat (one, "", 99); ++ DIAG_POP_NEEDS_COMMENT_CLANG; + equal (one, "ab", 8); + (void) strcpy (one, ""); ++ DIAG_PUSH_NEEDS_COMMENT_CLANG; ++ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wfortify-source"); + (void) strncat (one, "cd", 99); ++ DIAG_POP_NEEDS_COMMENT_CLANG; + equal (one, "cd", 9); + + (void) strcpy (one, "ab"); +@@ -423,7 +441,10 @@ test_strncat (void) + (void) strncat (one, "gh", 2); + equal (one, "abcdgh", 12); /* Count and length equal. */ + ++ DIAG_PUSH_NEEDS_COMMENT_CLANG; ++ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wfortify-source"); + (void) strncat (one, "ij", (size_t)-1); /* set sign bit in count */ ++ DIAG_POP_NEEDS_COMMENT_CLANG; + equal (one, "abcdghij", 13); + + int ntest = 14; +@@ -1427,7 +1448,12 @@ test_bzero (void) + equal(one+4, "ef", 3); + + (void) strcpy(one, "abcdef"); ++ ++ DIAG_PUSH_NEEDS_COMMENT_CLANG; ++ /* clang complains about the 0 size argument for bzero. */ ++ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wsuspicious-bzero"); + bzero(one+2, 0); ++ DIAG_POP_NEEDS_COMMENT_CLANG + equal(one, "abcdef", 4); /* Zero-length copy. */ + } + +-- +2.39.3 diff --git a/backport-clang-0046-dirent-Remove-variable-lenght-array-structure-for.patch b/backport-clang-0046-dirent-Remove-variable-lenght-array-structure-for.patch new file mode 100644 index 0000000000000000000000000000000000000000..4d173d8a22ab970354a6d2a0a9493d7967254b5a --- /dev/null +++ b/backport-clang-0046-dirent-Remove-variable-lenght-array-structure-for.patch @@ -0,0 +1,59 @@ +From 7438bae37bc2678b200eaa9366dfcbbd8fd5b7c7 Mon Sep 17 00:00:00 2001 +From: Adhemerval Zanella +Date: Fri, 25 Mar 2022 09:03:03 -0300 +Subject: [PATCH] dirent: Remove variable lenght array structure for + tst-getdents64.c + +Clang emits the following warnings: + + ../sysdeps/unix/sysv/linux/tst-getdents64.c:111:18: error: fields must + have a constant size: 'variable length array in structure' extension + will never be supported + char buffer[buffer_size]; + ^ +--- + sysdeps/unix/sysv/linux/tst-getdents64.c | 16 +++++----------- + 1 file changed, 5 insertions(+), 11 deletions(-) + +diff --git a/sysdeps/unix/sysv/linux/tst-getdents64.c b/sysdeps/unix/sysv/linux/tst-getdents64.c +index 39cf34cd4d..b177956ca6 100644 +--- a/sysdeps/unix/sysv/linux/tst-getdents64.c ++++ b/sysdeps/unix/sysv/linux/tst-getdents64.c +@@ -96,6 +96,8 @@ do_test_by_size (size_t buffer_size) + int fd = xopen (".", O_RDONLY | O_DIRECTORY, 0); + TEST_VERIFY (fd >= 0); + ++ char *data = xposix_memalign (_Alignof (struct dirent64), buffer_size); ++ + /* Perform two passes, with a rewind operating between passes. */ + for (int pass = 0; pass < 2; ++pass) + { +@@ -104,23 +106,15 @@ do_test_by_size (size_t buffer_size) + + while (true) + { +- /* Simple way to make sure that the memcpy below does not read +- non-existing data. */ +- struct +- { +- char buffer[buffer_size]; +- struct dirent64 pad; +- } data; +- +- ssize_t ret = getdents64 (fd, &data.buffer, sizeof (data.buffer)); ++ ssize_t ret = getdents64 (fd, data, buffer_size); + if (ret < 0) + FAIL_EXIT1 ("getdents64: %m"); + if (ret == 0) + break; + ++read_count; + +- char *current = data.buffer; +- char *end = data.buffer + ret; ++ char *current = data; ++ char *end = data + ret; + while (current != end) + { + struct dirent64 entry; +-- +2.39.3 diff --git a/backport-clang-0047-posix-Suppress-clang-warning-on-bug-regex24.patch b/backport-clang-0047-posix-Suppress-clang-warning-on-bug-regex24.patch new file mode 100644 index 0000000000000000000000000000000000000000..7a1cd9b0c4f40ba9f4f38fa2ea24824f2917f503 --- /dev/null +++ b/backport-clang-0047-posix-Suppress-clang-warning-on-bug-regex24.patch @@ -0,0 +1,44 @@ +From 7e86a6ef4e95f9085095b654ddbee3072a66869f Mon Sep 17 00:00:00 2001 +From: Adhemerval Zanella +Date: Fri, 25 Mar 2022 11:23:35 -0300 +Subject: [PATCH] posix: Suppress clang warning on bug-regex24 + +clang complains that adding a 'regoff_t' to a string doe snot +append to it, and the printf idea below is to make rm_so an +offset. +--- + posix/bug-regex24.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/posix/bug-regex24.c b/posix/bug-regex24.c +index 97c5c3508a..7a655cbc4d 100644 +--- a/posix/bug-regex24.c ++++ b/posix/bug-regex24.c +@@ -1,6 +1,7 @@ + #include + #include + #include ++#include + + #define str "civic" + +@@ -45,11 +46,17 @@ do_test (void) + { + int len = m[i].rm_eo - m[i].rm_so; + ++ /* clang complains that adding a 'regoff_t' to a string does not ++ append to it, and the printf idea below is to make rm_so as ++ an offset to str. */ ++ DIAG_PUSH_NEEDS_COMMENT_CLANG; ++ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int"); + printf ("m[%d] = \"%.*s\"\n", i, len, str + m[i].rm_so); + + if (strlen (expected[i]) != len + || memcmp (expected[i], str + m[i].rm_so, len) != 0) + result = 1; ++ DIAG_POP_NEEDS_COMMENT_CLANG; + } + + return result; +-- +2.39.3 diff --git a/backport-clang-0048-linux-Adequate-tst-clone3-to-c11-atomics.patch b/backport-clang-0048-linux-Adequate-tst-clone3-to-c11-atomics.patch new file mode 100644 index 0000000000000000000000000000000000000000..5bf79796cc96e7e84413d78659ed43619792d266 --- /dev/null +++ b/backport-clang-0048-linux-Adequate-tst-clone3-to-c11-atomics.patch @@ -0,0 +1,76 @@ +From ddd31c56655abcb09182240595aebc66ff13834f Mon Sep 17 00:00:00 2001 +From: Adhemerval Zanella +Date: Fri, 25 Mar 2022 11:27:46 -0300 +Subject: [PATCH] linux: Adequate tst-clone3 to c11 atomics + +--- + sysdeps/unix/sysv/linux/tst-clone3-internal.c | 8 +++----- + sysdeps/unix/sysv/linux/tst-clone3.c | 8 +++----- + 2 files changed, 6 insertions(+), 10 deletions(-) + +diff --git a/sysdeps/unix/sysv/linux/tst-clone3-internal.c b/sysdeps/unix/sysv/linux/tst-clone3-internal.c +index a88ce52cec..614488e7f8 100644 +--- a/sysdeps/unix/sysv/linux/tst-clone3-internal.c ++++ b/sysdeps/unix/sysv/linux/tst-clone3-internal.c +@@ -45,16 +45,14 @@ f (void *a) + implementation. */ + #define wait_tid(ctid_ptr, ctid_val) \ + do { \ +- __typeof (*(ctid_ptr)) __tid; \ + /* We need acquire MO here so that we synchronize with the \ + kernel's store to 0 when the clone terminates. */ \ +- while ((__tid = atomic_load_explicit (ctid_ptr, \ +- memory_order_acquire)) != 0) \ ++ while (atomic_load_explicit (ctid_ptr, memory_order_acquire) != 0) \ + futex_wait (ctid_ptr, ctid_val); \ + } while (0) + + static inline int +-futex_wait (int *futexp, int val) ++futex_wait (_Atomic pid_t *futexp, int val) + { + #ifdef __NR_futex + return syscall (__NR_futex, futexp, FUTEX_WAIT, val); +@@ -75,7 +73,7 @@ do_test (void) + /* Initialize with a known value. ctid is set to zero by the kernel after the + cloned thread has exited. */ + #define CTID_INIT_VAL 1 +- pid_t ctid = CTID_INIT_VAL; ++ _Atomic pid_t ctid = CTID_INIT_VAL; + pid_t tid; + + struct clone_args clone_args = +diff --git a/sysdeps/unix/sysv/linux/tst-clone3.c b/sysdeps/unix/sysv/linux/tst-clone3.c +index 87638e9578..c2b206fccb 100644 +--- a/sysdeps/unix/sysv/linux/tst-clone3.c ++++ b/sysdeps/unix/sysv/linux/tst-clone3.c +@@ -45,16 +45,14 @@ f (void *a) + implementation. */ + #define wait_tid(ctid_ptr, ctid_val) \ + do { \ +- __typeof (*(ctid_ptr)) __tid; \ + /* We need acquire MO here so that we synchronize with the \ + kernel's store to 0 when the clone terminates. */ \ +- while ((__tid = atomic_load_explicit (ctid_ptr, \ +- memory_order_acquire)) != 0) \ ++ while (atomic_load_explicit (ctid_ptr, memory_order_acquire) != 0) \ + futex_wait (ctid_ptr, ctid_val); \ + } while (0) + + static inline int +-futex_wait (int *futexp, int val) ++futex_wait (_Atomic pid_t *futexp, int val) + { + #ifdef __NR_futex + return syscall (__NR_futex, futexp, FUTEX_WAIT, val); +@@ -75,7 +73,7 @@ do_test (void) + /* Initialize with a known value. ctid is set to zero by the kernel after the + cloned thread has exited. */ + #define CTID_INIT_VAL 1 +- pid_t ctid = CTID_INIT_VAL; ++ _Atomic pid_t ctid = CTID_INIT_VAL; + pid_t tid; + + #ifdef __ia64__ +-- +2.39.3 diff --git a/backport-clang-0049-support-Suppress-clang-warning-on-tst-timespec.patch b/backport-clang-0049-support-Suppress-clang-warning-on-tst-timespec.patch new file mode 100644 index 0000000000000000000000000000000000000000..bb1539ee7c2d4191e3f95cc45b7605f9efd6eebc --- /dev/null +++ b/backport-clang-0049-support-Suppress-clang-warning-on-tst-timespec.patch @@ -0,0 +1,62 @@ +From aa3b5bf27485bc3a41d90604ae1d439238d0d85a Mon Sep 17 00:00:00 2001 +From: Adhemerval Zanella +Date: Fri, 25 Mar 2022 11:26:46 -0300 +Subject: [PATCH] support: Suppress clang warning on tst-timespec + +clang warns that converting from TIME_T_MAX to double (upper_bound) +loses precision (from 9223372036854775807 to 9223372036854775808): + + tst-timespec.c:290:19: error: implicit conversion from 'time_t' (aka + 'long') to 'double' changes value from 9223372036854775807 to + 9223372036854775808 [-Werror,-Wimplicit-const-int-float-conversion] + .upper_bound = TIME_T_MAX, .lower_bound = 1, .result = 1, + ^~~~~~~~~~ + tst-timespec.c:48:20: note: expanded from macro 'TIME_T_MAX' + #define TIME_T_MAX TYPE_MAXIMUM (time_t) + ^~~~~~~~~~~~~~~~~~~~~ + ../include/intprops.h:57:4: note: expanded from macro 'TYPE_MAXIMUM' + ((t) (! TYPE_SIGNED (t) + \ + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +It does not matter for the test. + +Checked on x86_64-linux-gnu. +--- + support/tst-timespec.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/support/tst-timespec.c b/support/tst-timespec.c +index 08c2c71ef5..a6d7864f81 100644 +--- a/support/tst-timespec.c ++++ b/support/tst-timespec.c +@@ -20,6 +20,7 @@ + #include + #include + #include ++#include + + #define TIMESPEC_HZ 1000000000 + +@@ -179,6 +180,11 @@ struct timespec_norm_test_case norm_cases[] = { + } + }; + ++/* clang warns that converting from TIME_T_MAX to double (upper_bound) ++ loses precision (from 9223372036854775807 to 9223372036854775808). ++ It does not matter in tests below. */ ++DIAG_PUSH_NEEDS_COMMENT_CLANG; ++DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wimplicit-const-int-float-conversion"); + /* Test cases for timespec_check_in_range */ + struct timespec_test_case check_cases[] = { + /* 0 - In range */ +@@ -290,6 +296,7 @@ struct timespec_test_case check_cases[] = { + .upper_bound = TIME_T_MAX, .lower_bound = 1, .result = 1, + }, + }; ++DIAG_POP_NEEDS_COMMENT_CLANG; + + static int + do_test (void) +-- +2.39.3 diff --git a/backport-clang-0050-elf-Suppress-clang-warning-on-tst-unique4.patch b/backport-clang-0050-elf-Suppress-clang-warning-on-tst-unique4.patch new file mode 100644 index 0000000000000000000000000000000000000000..409ad43a62df273856155be09eaf3d5836e57f98 --- /dev/null +++ b/backport-clang-0050-elf-Suppress-clang-warning-on-tst-unique4.patch @@ -0,0 +1,55 @@ +From c0be62be1d69127b90753b380193b361d2f48292 Mon Sep 17 00:00:00 2001 +From: Adhemerval Zanella +Date: Fri, 25 Mar 2022 11:21:33 -0300 +Subject: [PATCH] elf: Suppress clang warning on tst-unique4 + +clang warns that the instatiation of the variable is required, +but no definition is available. They are implemented on +tst-unique4lib.so. + +Checked on x86_64-linux-gnu. +--- + elf/tst-unique4.cc | 6 ++++++ + elf/tst-unique4lib.cc | 2 +- + 2 files changed, 7 insertions(+), 1 deletion(-) + +diff --git a/elf/tst-unique4.cc b/elf/tst-unique4.cc +index 575c70d3a1..ab727b8dbb 100644 +--- a/elf/tst-unique4.cc ++++ b/elf/tst-unique4.cc +@@ -2,7 +2,12 @@ + #include "tst-unique4.h" + + #include ++#include + ++/* clang warns that the instatiation of the variable is required, but no ++ definition is available. They are implemented on tst-unique4lib.so. */ ++DIAG_PUSH_NEEDS_COMMENT_CLANG; ++DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wundefined-var-template"); + static int a[24] = + { + S<1>::i, S<2>::i, S<3>::i, S<4>::i, S<5>::i, S<6>::i, S<7>::i, S<8>::i, +@@ -10,6 +15,7 @@ static int a[24] = + S<16>::i, S<17>::i, S<18>::i, S<19>::i, S<20>::i, S<21>::i, S<22>::i, + S<23>::i, S<24>::i + }; ++DIAG_POP_NEEDS_COMMENT_CLANG; + + int + main (void) +diff --git a/elf/tst-unique4lib.cc b/elf/tst-unique4lib.cc +index 17a7cdf567..2829e75cee 100644 +--- a/elf/tst-unique4lib.cc ++++ b/elf/tst-unique4lib.cc +@@ -2,7 +2,7 @@ + #include "tst-unique4.h" + + template +-int S::i = N; ++int S::i __attribute__ ((used)) = N; + template + const int S::j __attribute__ ((used)) = -1; + +-- +2.39.3 diff --git a/backport-clang-0051-elf-Suppress-clang-warning-on-tst-unique3.patch b/backport-clang-0051-elf-Suppress-clang-warning-on-tst-unique3.patch new file mode 100644 index 0000000000000000000000000000000000000000..e41eee6f9cbd38edbfd75545842d87ea11467b1b --- /dev/null +++ b/backport-clang-0051-elf-Suppress-clang-warning-on-tst-unique3.patch @@ -0,0 +1,38 @@ +From 38e5e71cd0c0eab0e5228e172c36361fbe08bea0 Mon Sep 17 00:00:00 2001 +From: Adhemerval Zanella +Date: Fri, 25 Mar 2022 11:17:39 -0300 +Subject: [PATCH] elf: Suppress clang warning on tst-unique3 + +clang warns that the instatiation of the variable is required, +but no definition is available. They are implemented on +tst-unique3lib.so. + +Checked on x86_64-linux-gnu. +--- + elf/tst-unique3.cc | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +diff --git a/elf/tst-unique3.cc b/elf/tst-unique3.cc +index efdd6d78c2..d07601fe6d 100644 +--- a/elf/tst-unique3.cc ++++ b/elf/tst-unique3.cc +@@ -1,9 +1,14 @@ +-#include "tst-unique3.h" +- + #include +-#include "../dlfcn/dlfcn.h" ++#include ++#include ++#include "tst-unique3.h" + ++/* clang warns that the instatiation of the variable is required, but no ++ definition is available. They are implemented on tst-unique3lib.so. */ ++DIAG_PUSH_NEEDS_COMMENT_CLANG; ++DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wundefined-var-template"); + int t = S::i; ++DIAG_POP_NEEDS_COMMENT_CLANG; + + int + main (void) +-- +2.39.3 diff --git a/backport-clang-0052-elf-Disable-unload4-test-on-clang.patch b/backport-clang-0052-elf-Disable-unload4-test-on-clang.patch new file mode 100644 index 0000000000000000000000000000000000000000..29bf0c328da9b39727d709cfef87ee5a5c4a30dd --- /dev/null +++ b/backport-clang-0052-elf-Disable-unload4-test-on-clang.patch @@ -0,0 +1,33 @@ +From a32a314b6e7f02e762de2fae40fa5fe54fda83e8 Mon Sep 17 00:00:00 2001 +From: Adhemerval Zanella +Date: Fri, 26 Aug 2022 09:24:25 -0300 +Subject: [PATCH] elf: Disable unload4 test on clang + +It triggers and infintie loop. +--- + elf/unload4.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/elf/unload4.c b/elf/unload4.c +index 6e171a22e0..97ab6dafcc 100644 +--- a/elf/unload4.c ++++ b/elf/unload4.c +@@ -5,6 +5,10 @@ + int + main (void) + { ++#ifdef __clang__ ++ /* It triggers an infinite loop on clang. */ ++ return 77; ++#else + #ifdef M_PERTURB + mallopt (M_PERTURB, 0xaa); + #endif +@@ -45,4 +49,5 @@ main (void) + } + dlclose (h); + return 0; ++#endif + } +-- +2.39.3 diff --git a/glibc.spec b/glibc.spec index 8bcb785c5372442ceba8014f1447489333c26922..cee684d8b87a4cf04d988e04074398347116fa44 100644 --- a/glibc.spec +++ b/glibc.spec @@ -60,14 +60,14 @@ %endif %define x86_arches %{ix86} x86_64 %define all_license LGPLv2+ and LGPLv2+ with exceptions and GPLv2+ and GPLv2+ with exceptions and BSD and Inner-Net and ISC and Public Domain and GFDL -%define GCC gcc -%define GXX g++ +%define GCC %{__cc} +%define GXX %{__cxx} ############################################################################## # glibc - The GNU C Library (glibc) core package. ############################################################################## Name: glibc Version: 2.38 -Release: 24 +Release: 25 Summary: The GNU libc libraries License: %{all_license} URL: http://www.gnu.org/software/glibc/ @@ -193,8 +193,63 @@ Patch9017: fix-Segmentation-fault-in-nss-module.patch Patch9018: fix_nss_database_check_reload_and_get_memleak.patch Patch9019: 0001-fix-glibc-build-error-on-x86.patch +%if "%{toolchain}" == "clang" +Patch9020: backport-clang-0001-configure-remove-overly-restrictive-check-for-clang.patch +Patch9021: backport-clang-0002-Use-frounding-math-iff-compiler-supports-it.patch +Patch9022: backport-clang-0003-Disable-__USE_EXTERN_INLINES-for-clang.patch +Patch9023: backport-clang-0004-aarch64-Use-64-bit-variable-to-access-the-special-registers.patch +Patch9024: backport-clang-0005-nptl-Fix-Wincompatible-pointer-types-on-clang.patch +Patch9025: backport-clang-0006-stdlib-Remove-Wmaybe-uninitialized-supression-on-setenv.patch +Patch9026: backport-clang-0007-Add-clang-specific-warnings-suppress-macros.patch +Patch9027: backport-clang-0008-Suppress-Wmaybe-uninitialized-only-for-gcc.patch +Patch9028: backport-clang-0009-posix-Use-unsigned-to-check-for-_POSIX_VDISABLE.patch +Patch9029: backport-clang-0010-resolv-Handle-Wsometimes-uninitialized-on-getaddrinfo.patch +Patch9030: backport-clang-0011-misc-Suppress-clang-warnings-on-syslog.patch +Patch9031: backport-clang-0012-argp-Expand-argp_usage-_option_is_short-and-_option_is_end.patch +Patch9032: backport-clang-0013-nss-Suppress-nss_module.c-warning-on-clang.patch +Patch9033: backport-clang-0014-sunrpc-Remove-extra-parenthesis-on-comparison.patch +Patch9034: backport-clang-0015-sunrpc-Suppress-clang-warning-on-struct-cmessage.patch +Patch9035: backport-clang-0016-elf-Supress-clang-Wsometimes-uninitialized-on.patch +Patch9036: backport-clang-0017-configure-Fix-check-for-fno-tree-loop-distribute-patterns.patch +Patch9037: backport-clang-0018-elf-Suppress-clang-Wstring-plus-int-on-rtld-c.patch +Patch9038: backport-clang-0019-Remove-include-h-install-rule.patch +Patch9039: backport-clang-0020-locale-Fix-implicit-conversion-on-collate_finish.patch +Patch9040: backport-clang-0021-iconvdata-Suppress-clang-warning-on-locale-definitions.patch +Patch9041: backport-clang-0022-iconvdata-Remove-use-of-GNU-old-style-field-designator.patch +Patch9042: backport-clang-0023-catgets-Remove-catgets-config-h.patch +Patch9044: backport-clang-0024-configure-Use-Wno-maybe-uninitialized-iff-compiler-supports.patch +Patch9045: backport-clang-0025-timezone-Fix-clang-operator-precedence-warning.patch +Patch9046: backport-clang-0026-support-Handle-clang-support-dtotimespec-c-on-dtotimespec.patch +Patch9047: backport-clang-0027-support-Use-CHAR_MAX-as-maximum-value.patch +Patch9048: backport-clang-0028-localedata-Use-hexadecimal-character-escape-on-tests.patch +Patch9049: backport-clang-0029-localedata-Fix-clang-warnings-on-tests.patch +Patch9050: backport-clang-0030-Use-ffloat-store-iff-compiler-supports-it.patch +Patch9051: backport-clang-0031-math-Define-CMPLX-F-L-for-clang.patch +Patch9052: backport-clang-0032-math-Only-build-tests-for-_Complex-__int128-iff-compiler.patch +Patch9053: backport-clang-0033-stdlib-Avoid-internal-definitions-for-tst-strtod5i.patch +Patch9054: backport-clang-0034-stdio-Suppress-Z-format-for-clang.patch +Patch9055: backport-clang-0035-stdio-Disable-bug23-3-on-clang.patch +Patch9056: backport-clang-0036-stdio-Disable-clang-warning-on-scanf13-test.patch +Patch9057: backport-clang-0037-stdio-Fix-clang-warnings-on-tests.patch +Patch9058: backport-clang-0038-stdio-Suppress-Wformat-only-for-gcc-for-tst-sprintf-errno-c.patch +Patch9059: backport-clang-0039-stdio-Suppress-clang-warnings-for-tst-unlockedio-c.patch +Patch9060: backport-clang-0040-stdio-Suppress-clang-warnings-for-tst-vprintf-width-i18n-c.patch +Patch9061: backport-clang-0041-Handle-pragma-GCC-optimize-for-clang.patch +Patch9062: backport-clang-0042-Use-check-tests-with-trampolines-iff-compiler-supports-it.patch +Patch9063: backport-clang-0043-malloc-Suppress-clang-warning-on-tst-memalign.patch +Patch9064: backport-clang-0044-malloc-Suppress-clang-warning-on-tst-aligned-alloc.patch +Patch9065: backport-clang-0045-string-Suppress-clang-Wsuspicious-bzero-on-tester.patch +Patch9066: backport-clang-0046-dirent-Remove-variable-lenght-array-structure-for.patch +Patch9067: backport-clang-0047-posix-Suppress-clang-warning-on-bug-regex24.patch +Patch9068: backport-clang-0048-linux-Adequate-tst-clone3-to-c11-atomics.patch +Patch9069: backport-clang-0049-support-Suppress-clang-warning-on-tst-timespec.patch +Patch9070: backport-clang-0050-elf-Suppress-clang-warning-on-tst-unique4.patch +Patch9071: backport-clang-0051-elf-Suppress-clang-warning-on-tst-unique3.patch +Patch9072: backport-clang-0052-elf-Disable-unload4-test-on-clang.patch +%endif + %if %{ENABLE_RELOC} -Patch9021: reserve-relocation-information-for-sysboost.patch +Patch9074: reserve-relocation-information-for-sysboost.patch %endif Provides: ldconfig rtld(GNU_HASH) bundled(gnulib) @@ -499,7 +554,7 @@ touch locale/programs/*-kw.h ############################################################################## %build -BuildFlags="-O2 -g -DNDEBUG -fPIC -fPIE -fstack-protector-strong" +BuildFlags="-O2 -g -DNDEBUG -fPIC -fPIE -fstack-protector-strong %["%{toolchain}" == "clang" ? "-Wno-ignored-attributes -Wno-unknown-attributes -Wno-error=unused-function -Wno-error=absolute-value -Wno-error=unknown-warning-option" : ""]" LinkFlags="-pie -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack" %ifarch aarch64 @@ -509,7 +564,9 @@ BuildFlags="$BuildFlags -mno-outline-atomics" reference=" \ "-Wp,-D_GLIBCXX_ASSERTIONS" \ "-fasynchronous-unwind-tables" \ +%if "%{toolchain}" != "clang" "-fstack-clash-protection" \ +%endif "-funwind-tables" \ "-m31" \ "-m32" \ @@ -535,7 +592,7 @@ for flag in $RPM_OPT_FLAGS $RPM_LD_FLAGS ; do fi done -%define glibc_make_flags_as ASFLAGS="-g -Wa,--generate-missing-build-notes=yes" +%define glibc_make_flags_as ASFLAGS="-g %[ "%{toolchain}" == "clang" ? "" : "-Wa,--generate-missing-build-notes=yes"] " %define glibc_make_flags %{glibc_make_flags_as} EnableKernel="--enable-kernel=%{enablekernel}" @@ -576,6 +633,9 @@ pushd $builddir %endif %if 0%{rpm_version_ge_412} --disable-crypt \ +%endif +%if "%{toolchain}" == "clang" + --disable-mathvec \ %endif || { cat config.log; false; } @@ -1392,6 +1452,9 @@ fi %endif %changelog +* Mon Apr 1 2024 liyunfei - 2.38-25 +- add clang compile support + * Tue Apr 9 2024 yangpan - 2.38-24 - disable sysboost