aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Sebor <msebor@redhat.com>2022-01-24 17:56:23 +0000
committerNick Clifton <nickc@redhat.com>2022-01-24 17:56:23 +0000
commit2f279a64a27bca5be4393e84cbb579e18ef4a4ad (patch)
tree1ce6973975e57656a8e191a931f2e00f74d748d5
parent965c919f98ea394a333034d50831997c69feb1e5 (diff)
downloadgdb-2f279a64a27bca5be4393e84cbb579e18ef4a4ad.zip
gdb-2f279a64a27bca5be4393e84cbb579e18ef4a4ad.tar.gz
gdb-2f279a64a27bca5be4393e84cbb579e18ef4a4ad.tar.bz2
Fix a proble building the libiberty library with gcc-12.
PR 28779 * regex.c: Suppress -Wuse-after-free.
-rw-r--r--libiberty/ChangeLog4
-rw-r--r--libiberty/regex.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 04c9e90..40611e5 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,7 @@
+2022-01-15 Martin Sebor <msebor@redhat.com>
+
+ * regex.c: Suppress -Wuse-after-free.
+
2022-01-22 Nick Clifton <nickc@redhat.com>
* 2.38 release branch created.
diff --git a/libiberty/regex.c b/libiberty/regex.c
index cc5a460..84af527 100644
--- a/libiberty/regex.c
+++ b/libiberty/regex.c
@@ -30,6 +30,10 @@
#pragma alloca
#endif
+#if __GNUC__ >= 12
+# pragma GCC diagnostic ignored "-Wuse-after-free"
+#endif
+
#undef _GNU_SOURCE
#define _GNU_SOURCE