From: Tobias Burnus Date: Wed, 23 Sep 2020 09:07:40 +0000 (+0200) Subject: gcc/analyzer: Silence -Wpragma warns with GCC < 10 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5253b3e6deda1caa9432f5ac56e78bd999fb9f85;p=gcc.git 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. --- 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. */