public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-4801] build: avoid -Wconditionally-supported on qsort check
@ 2022-12-19 20:46 Jason Merrill
0 siblings, 0 replies; only message in thread
From: Jason Merrill @ 2022-12-19 20:46 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:1e007fa5c92ae2d6b64854a6faad7e85b43d64f2
commit r13-4801-g1e007fa5c92ae2d6b64854a6faad7e85b43d64f2
Author: Jason Merrill <jason@redhat.com>
Date: Mon Dec 19 15:41:36 2022 -0500
build: avoid -Wconditionally-supported on qsort check
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.
Diff:
---
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
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-12-19 20:46 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-19 20:46 [gcc r13-4801] build: avoid -Wconditionally-supported on qsort check Jason Merrill
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).