summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <meyering@fb.com>2022-12-11 09:28:57 -0800
committerJim Meyering <meyering@fb.com>2022-12-30 13:32:57 -0800
commiteb3085a076c94cc4b48233ce8fa9de60bd734467 (patch)
tree4e2bd0a224a6284d9d83722a685a2a1797182a4e
parent4e9063a17b272922d1adb9abf5e3e6e2f01d02fe (diff)
downloaddiffutils-eb3085a076c94cc4b48233ce8fa9de60bd734467.tar.gz
build: temp?-disable -Wanalyzer-use-of-uninitialized-value
* src/util.c (print_message_queue): This function triggers false positive warnings from GCC12, so add pragmas to ignore that new warning in this one function. Required when using either of these: - gcc version 12.2.1 20221121 - gcc version 13.0.0 20221229 (experimental)
-rw-r--r--src/util.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/util.c b/src/util.c
index bdc2bda..d2fd5ca 100644
--- a/src/util.c
+++ b/src/util.c
@@ -153,6 +153,13 @@ message (char const *format_msgid, ...)
va_end (ap);
}
+/* Suppress false positive from gcc version 13.0.0 20221208 (experimental) (GCC)
+ */
+_Pragma ("GCC diagnostic push")
+#if 12 <= __GNUC__
+_Pragma ("GCC diagnostic ignored \"-Wanalyzer-use-of-uninitialized-value\"")
+#endif
+
/* Output all the messages that were saved up by calls to 'message'. */
void
@@ -178,7 +185,8 @@ print_message_queue (void)
m = next;
}
}
-
+_Pragma ("GCC diagnostic pop")
+
/* Signal handling, needed for restoring default colors. */
static void