gcc/analyzer: Silence -Wpragma warns with GCC < 10
authorTobias Burnus <tobias@codesourcery.com>
Wed, 23 Sep 2020 09:07:40 +0000 (11:07 +0200)
committerTobias Burnus <tobias@codesourcery.com>
Wed, 23 Sep 2020 09:07:40 +0000 (11:07 +0200)
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
gcc/analyzer/analyzer.h
gcc/analyzer/call-string.cc

index d2bbd05..583840a 100644 (file)
@@ -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 {
 
index d234fcf..b85edb1 100644 (file)
@@ -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 */
index 72568c6..8dfd157 100644 (file)
@@ -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.  */