From 1734a95cca91d923dc3cc254b12944805c57f7df Mon Sep 17 00:00:00 2001 From: Chris Spiegel Date: Sun, 29 Dec 2024 08:11:35 -0800 Subject: [PATCH] Ignore "array out of bounds" warning in nlohmann-json These are false positives (see https://github.com/nlohmann/json/issues/3808), and really clutter up the output during a build. --- garglk/theme.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/garglk/theme.cpp b/garglk/theme.cpp index bc8a13e6f..92dfd9134 100644 --- a/garglk/theme.cpp +++ b/garglk/theme.cpp @@ -36,9 +36,18 @@ #endif #include "format.h" +#include "optional.hpp" + #define JSON_DIAGNOSTICS 1 +#ifdef __GNUC__ +// Ignore false positives (see https://github.com/nlohmann/json/issues/3808) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Warray-bounds" #include "json.hpp" -#include "optional.hpp" +#pragma GCC diagnostic pop +#else +#include "json.hpp" +#endif #include "garglk.h"