Files
allwpilib/upstream_utils/libuv_patches/0007-Squelch-GCC-12.1-warnings.patch

56 lines
1.7 KiB
Diff

From 5266f44aa4ad009f384cc8afd63bb3414fe9e553 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/9] 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 4176395..779e8ff 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 534119c..00d0332 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.25.1