Files
allwpilib/upstream_utils/libuv_patches/0007-Squelch-GCC-12.1-warnings.patch
2022-05-18 20:40:27 -07:00

56 lines
1.7 KiB
Diff

From aa760b0bb41c8052f47f9d49eb100340c1c76634 Mon Sep 17 00:00:00 2001
From: Tyler Veness <calcmogul@gmail.com>
Date: Tue, 17 May 2022 21:36:57 -0700
Subject: [PATCH 7/7] Squelch GCC 12.1 warnings
---
src/unix/stream.c | 9 +++++++++
src/uv-common.c | 9 +++++++++
2 files changed, 18 insertions(+)
diff --git a/src/unix/stream.c b/src/unix/stream.c
index 41763959..779e8ff8 100644
--- a/src/unix/stream.c
+++ b/src/unix/stream.c
@@ -941,7 +941,16 @@ static void uv__write_callbacks(uv_stream_t* stream) {
if (QUEUE_EMPTY(&stream->write_completed_queue))
return;
+// FIXME: GCC 12.1 gives a possibly real warning, but we don't know how to fix
+// it
+#if __GNUC__ >= 12
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdangling-pointer="
+#endif // __GNUC__ >= 12
QUEUE_MOVE(&stream->write_completed_queue, &pq);
+#if __GNUC__ >= 12
+#pragma GCC diagnostic pop
+#endif // __GNUC__ >= 12
while (!QUEUE_EMPTY(&pq)) {
/* Pop a req off write_completed_queue. */
diff --git a/src/uv-common.c b/src/uv-common.c
index 534119c0..00d03320 100644
--- a/src/uv-common.c
+++ b/src/uv-common.c
@@ -502,7 +502,16 @@ void uv_walk(uv_loop_t* loop, uv_walk_cb walk_cb, void* arg) {
QUEUE* q;
uv_handle_t* h;
+// FIXME: GCC 12.1 gives a possibly real warning, but we don't know how to fix
+// it
+#if __GNUC__ >= 12
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdangling-pointer="
+#endif // __GNUC__ >= 12
QUEUE_MOVE(&loop->handle_queue, &queue);
+#if __GNUC__ >= 12
+#pragma GCC diagnostic pop
+#endif // __GNUC__ >= 12
while (!QUEUE_EMPTY(&queue)) {
q = QUEUE_HEAD(&queue);
h = QUEUE_DATA(q, uv_handle_t, handle_queue);
--
2.36.1