From a14ce4c7cbd15aecbf8291eab8fb396c81577b78 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 19 Jan 2021 19:57:37 +0100 Subject: [PATCH] lib/pcre/RegexPointer: work around bogus -Wmaybe-uninitialized with GCC 11 --- src/lib/pcre/RegexPointer.hxx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/lib/pcre/RegexPointer.hxx b/src/lib/pcre/RegexPointer.hxx index 7311d0407..cb7e730ba 100644 --- a/src/lib/pcre/RegexPointer.hxx +++ b/src/lib/pcre/RegexPointer.hxx @@ -40,6 +40,13 @@ #include +#if GCC_CHECK_VERSION(11,0) +#pragma GCC diagnostic push +/* bogus GCC 11 warning "ovector may be used uninitialized" in the + ovector.size() call */ +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#endif + class RegexPointer { protected: pcre *re = nullptr; @@ -63,4 +70,8 @@ public: } }; +#if GCC_CHECK_VERSION(11,0) +#pragma GCC diagnostic pop +#endif + #endif