From c4146d8813a0f8a7f83584f2a131504cee663baa Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Thu, 21 Dec 2023 10:21:20 -0800 Subject: [PATCH] misc: Fix 'maybe-uninitialized' warn turn off (#706) https://github.com/gem5/gem5/pull/696 was implemented incorrectly and and causes error when running with GCC 12.1. This patch fixes the error. --- src/kern/linux/helpers.cc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/kern/linux/helpers.cc b/src/kern/linux/helpers.cc index eb4db9e551..871492ed46 100644 --- a/src/kern/linux/helpers.cc +++ b/src/kern/linux/helpers.cc @@ -45,12 +45,10 @@ // ignore 'maybe-uniitialized' warnings for GCC 12.1. #if __GNUC__ && __GNUC__ == 12 && __GNUC_MINOR__ == 1 - #if __has_warning( "-Wmaybe-uninitialized" ) - #define SUPPRESSING_MAYBE_UNINITIALIZED_WARNING - // save diagnostic state. - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" - #endif + #define SUPPRESSING_MAYBE_UNINITIALIZED_WARNING + // save diagnostic state. + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #endif #include #ifdef SUPPRESSING_MAYBE_UNINITIALIZED_WARNING