From 9882aec279cbea28f5cd9ff40fc0f3e3988ab6f0 Mon Sep 17 00:00:00 2001 From: Antonio Sanchez Date: Fri, 17 Sep 2021 10:36:47 -0700 Subject: [PATCH] Silence string overflow warning for GCC in initializer_list_construction test. This looks to be a GCC bug. It doesn't seem to reproduce is a smaller example, making it hard to isolate. --- test/initializer_list_construction.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/initializer_list_construction.cpp b/test/initializer_list_construction.cpp index 71a6597b7..b576ec2a7 100644 --- a/test/initializer_list_construction.cpp +++ b/test/initializer_list_construction.cpp @@ -7,6 +7,13 @@ // Public License v. 2.0. If a copy of the MPL was not distributed // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. +#if defined(__GNUC__) && __GNUC__ >= 10 +// GCC 10+ has a bug for unsigned char that thinks we're writing past the +// end of an array when compiled with -O3. This warning is not triggered for +// any other types, nor for other compilers, nor for other optimization levels. +#pragma GCC diagnostic ignored "-Wstringop-overflow" +#endif + #include "main.h" template::IsInteger> -- GitLab