From 470d02572d6cba8179e8e79c2a86f14afd1fd0df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Mon, 3 Apr 2023 16:09:41 +0200 Subject: [PATCH] Fix #17371: GCC regression with -Wmaybe-uninitialized (#19810) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105937 was reported for GCC12 and fixed in GCC13 (not yet released). Leave the suppresions in place until we can get rid of GCC12 --- src/openrct2/drawing/Drawing.String.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/openrct2/drawing/Drawing.String.cpp b/src/openrct2/drawing/Drawing.String.cpp index e96d5e3eb2..91c476a170 100644 --- a/src/openrct2/drawing/Drawing.String.cpp +++ b/src/openrct2/drawing/Drawing.String.cpp @@ -843,14 +843,14 @@ static void TTFProcessStringLiteral(DrawPixelInfo& dpi, std::string_view text, T // Draw the TTF run // This error suppression abomination is here to suppress https://github.com/OpenRCT2/OpenRCT2/issues/17371. // Additionally, we have to suppress the error for the error suppression... :'-( - // TODO: Re-evaluate somewhere in 2023. -# ifdef __MINGW32__ + // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105937 is fixed in GCC13 +# if defined(__GNUC__) && !defined(__clang__) # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wmaybe-uninitialized" # endif auto len = it.GetIndex() - ttfRunIndex.value(); TTFDrawStringRawTTF(dpi, text.substr(ttfRunIndex.value(), len), info); -# ifdef __MINGW32__ +# if defined(__GNUC__) && !defined(__clang__) # pragma GCC diagnostic pop # endif ttfRunIndex = std::nullopt;