From 5253b3e6deda1caa9432f5ac56e78bd999fb9f85 Mon Sep 17 00:00:00 2001 From: Tobias Burnus Date: Wed, 23 Sep 2020 11:07:40 +0200 Subject: [PATCH] gcc/analyzer: Silence -Wpragma warns with GCC < 10 gcc/analyzer/ChangeLog: * analyzer-logging.cc: Guard '#pragma ... ignored "-Wformat-diag"' by '#if __GNUC__ >= 10' * analyzer.h: Likewise. * call-string.cc: Likewise. --- gcc/analyzer/analyzer-logging.cc | 2 ++ gcc/analyzer/analyzer.h | 3 ++- gcc/analyzer/call-string.cc | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gcc/analyzer/analyzer-logging.cc b/gcc/analyzer/analyzer-logging.cc index d2bbd05d323..583840ab25a 100644 --- a/gcc/analyzer/analyzer-logging.cc +++ b/gcc/analyzer/analyzer-logging.cc @@ -30,7 +30,9 @@ along with GCC; see the file COPYING3. If not see #if ENABLE_ANALYZER +#if __GNUC__ >= 10 #pragma GCC diagnostic ignored "-Wformat-diag" +#endif namespace ana { diff --git a/gcc/analyzer/analyzer.h b/gcc/analyzer/analyzer.h index d234fcf47e7..b85edb15c7c 100644 --- a/gcc/analyzer/analyzer.h +++ b/gcc/analyzer/analyzer.h @@ -301,7 +301,8 @@ private: /* Disable -Wformat-diag; we want to be able to use pp_printf for logging/dumping without complying with the rules for diagnostics. */ - +#if __GNUC__ >= 10 #pragma GCC diagnostic ignored "-Wformat-diag" +#endif #endif /* GCC_ANALYZER_ANALYZER_H */ diff --git a/gcc/analyzer/call-string.cc b/gcc/analyzer/call-string.cc index 72568c6efa7..8dfd1577585 100644 --- a/gcc/analyzer/call-string.cc +++ b/gcc/analyzer/call-string.cc @@ -39,7 +39,9 @@ along with GCC; see the file COPYING3. If not see #if ENABLE_ANALYZER +#if __GNUC__ >= 10 #pragma GCC diagnostic ignored "-Wformat-diag" +#endif /* class call_string. */ -- 2.30.2