From 2f279a64a27bca5be4393e84cbb579e18ef4a4ad Mon Sep 17 00:00:00 2001 From: Martin Sebor Date: Mon, 24 Jan 2022 17:56:23 +0000 Subject: [PATCH] Fix a proble building the libiberty library with gcc-12. PR 28779 * regex.c: Suppress -Wuse-after-free. --- libiberty/ChangeLog | 4 ++++ libiberty/regex.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index 04c9e90a45b..40611e56ff4 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,7 @@ +2022-01-15 Martin Sebor + + * regex.c: Suppress -Wuse-after-free. + 2022-01-22 Nick Clifton * 2.38 release branch created. diff --git a/libiberty/regex.c b/libiberty/regex.c index cc5a4605ced..84af5276ae8 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 -- 2.30.2