From eef0873b6906d5404a04b817377c33f585cf3f21 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Mon, 19 Dec 2022 15:41:36 -0500 Subject: [PATCH] build: avoid -Wconditionally-supported on qsort check To: gcc-patches@gcc.gnu.org It's OK to rely on conditionally-supported features in #if CHECKING_P, since that isn't defined in stage 1. gcc/ChangeLog: * sort.cc: Disable -Wconditionally-supported in CHECKING_P code. --- gcc/sort.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gcc/sort.cc b/gcc/sort.cc index 87f826818bb..eeddfcf1fef 100644 --- a/gcc/sort.cc +++ b/gcc/sort.cc @@ -237,6 +237,10 @@ do { \ } #if CHECKING_P + /* Don't complain about cast from void* to function pointer. */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconditionally-supported" + /* Adapter for using two-argument comparators in functions expecting the three-argument sort_r_cmp_fn type. */ static int @@ -266,6 +270,7 @@ gcc_qsort (void *vbase, size_t n, size_t size, cmp_fn *cmp) free (buf); #if CHECKING_P qsort_chk (vbase, n, size, cmp2to3, (void*)cmp); +#pragma GCC diagnostic pop #endif } -- 2.31.1