public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix Werror=format-diag with --disable-nls.
@ 2022-01-20  9:43 Martin Liška
  2022-01-20 10:17 ` Jakub Jelinek
  0 siblings, 1 reply; 9+ messages in thread
From: Martin Liška @ 2022-01-20  9:43 UTC (permalink / raw)
  To: gcc-patches

The patch disables "-Wformat-diag" for dump_aggr_type.

Patch can bootstrap on x86_64-linux-gnu and survives regression tests.

Ready to be installed?
Thanks,
Martin

	PR c++/104134

gcc/cp/ChangeLog:

	* error.cc (dump_aggr_type): Partially disable the warning.
---
  gcc/cp/error.cc | 9 +++++++++
  1 file changed, 9 insertions(+)

diff --git a/gcc/cp/error.cc b/gcc/cp/error.cc
index 1ab0c25a477..c031c75cc5e 100644
--- a/gcc/cp/error.cc
+++ b/gcc/cp/error.cc
@@ -768,6 +768,11 @@ class_key_or_enum_as_string (tree t)
      return "struct";
  }
  
+#if __GNUC__ >= 10
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-diag"
+#endif
+
  /* Print out a class declaration T under the control of FLAGS,
     in the form `class foo'.  */
  
@@ -851,6 +856,10 @@ dump_aggr_type (cxx_pretty_printer *pp, tree t, int flags)
  			 flags & ~TFF_TEMPLATE_HEADER);
  }
  
+#if __GNUC__ >= 10
+#pragma GCC diagnostic pop
+#endif
+
  /* Dump into the obstack the initial part of the output for a given type.
     This is necessary when dealing with things like functions returning
     functions.  Examples:
-- 
2.34.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-01-20 18:19 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-20  9:43 [PATCH] Fix Werror=format-diag with --disable-nls Martin Liška
2022-01-20 10:17 ` Jakub Jelinek
2022-01-20 10:28   ` Jakub Jelinek
2022-01-20 16:33     ` Martin Sebor
2022-01-20 16:43       ` Jakub Jelinek
2022-01-20 16:56         ` Martin Sebor
2022-01-20 17:03           ` Jakub Jelinek
2022-01-20 17:52             ` Martin Sebor
2022-01-20 18:18               ` Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).