From 8ac1e8510d919c6f44e13f9b2f66d26374a4aa92 Mon Sep 17 00:00:00 2001
From: David Malcolm <dmalcolm@redhat.com>
Date: Fri, 10 Aug 2018 13:46:59 -0400
Subject: [PATCH 12/18] FIXME: temporary hack to remove 'bool' from
 diagnostics, to help locate grouped diagnostics

---
 gcc/diagnostic-core.h | 18 ++++++++---------
 gcc/diagnostic.c      | 53 +++++++++++++++++++++------------------------------
 2 files changed, 31 insertions(+), 40 deletions(-)

diff --git a/gcc/diagnostic-core.h b/gcc/diagnostic-core.h
index 79b84a7..0464c1f 100644
--- a/gcc/diagnostic-core.h
+++ b/gcc/diagnostic-core.h
@@ -80,16 +80,16 @@ extern void internal_error (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2)
 extern void internal_error_no_backtrace (const char *, ...)
      ATTRIBUTE_GCC_DIAG(1,2) ATTRIBUTE_NORETURN;
 /* Pass one of the OPT_W* from options.h as the first parameter.  */
-extern bool warning (int, const char *, ...) ATTRIBUTE_GCC_DIAG(2,3);
-extern bool warning_n (location_t, int, unsigned HOST_WIDE_INT,
+extern void warning (int, const char *, ...) ATTRIBUTE_GCC_DIAG(2,3);
+extern void warning_n (location_t, int, unsigned HOST_WIDE_INT,
 		       const char *, const char *, ...)
     ATTRIBUTE_GCC_DIAG(4,6) ATTRIBUTE_GCC_DIAG(5,6);
-extern bool warning_n (rich_location *, int, unsigned HOST_WIDE_INT,
+extern void warning_n (rich_location *, int, unsigned HOST_WIDE_INT,
 		       const char *, const char *, ...)
     ATTRIBUTE_GCC_DIAG(4, 6) ATTRIBUTE_GCC_DIAG(5, 6);
-extern bool warning_at (location_t, int, const char *, ...)
+extern void warning_at (location_t, int, const char *, ...)
     ATTRIBUTE_GCC_DIAG(3,4);
-extern bool warning_at (rich_location *, int, const char *, ...)
+extern void warning_at (rich_location *, int, const char *, ...)
     ATTRIBUTE_GCC_DIAG(3,4);
 extern void error (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2);
 extern void error_n (location_t, unsigned HOST_WIDE_INT, const char *,
@@ -101,12 +101,12 @@ extern void error_at (rich_location *, const char *, ...)
 extern void fatal_error (location_t, const char *, ...) ATTRIBUTE_GCC_DIAG(2,3)
      ATTRIBUTE_NORETURN;
 /* Pass one of the OPT_W* from options.h as the second parameter.  */
-extern bool pedwarn (location_t, int, const char *, ...)
+extern void pedwarn (location_t, int, const char *, ...)
      ATTRIBUTE_GCC_DIAG(3,4);
-extern bool pedwarn (rich_location *, int, const char *, ...)
+extern void pedwarn (rich_location *, int, const char *, ...)
      ATTRIBUTE_GCC_DIAG(3,4);
-extern bool permerror (location_t, const char *, ...) ATTRIBUTE_GCC_DIAG(2,3);
-extern bool permerror (rich_location *, const char *,
+extern void permerror (location_t, const char *, ...) ATTRIBUTE_GCC_DIAG(2,3);
+extern void permerror (rich_location *, const char *,
 				   ...) ATTRIBUTE_GCC_DIAG(2,3);
 extern void sorry (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2);
 extern void inform (location_t, const char *, ...) ATTRIBUTE_GCC_DIAG(2,3);
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c
index 980d750..e861521 100644
--- a/gcc/diagnostic.c
+++ b/gcc/diagnostic.c
@@ -1324,49 +1324,46 @@ inform_n (location_t location, unsigned HOST_WIDE_INT n,
 /* A warning at INPUT_LOCATION.  Use this for code which is correct according
    to the relevant language specification but is likely to be buggy anyway.
    Returns true if the warning was printed, false if it was inhibited.  */
-bool
+void
 warning (int opt, const char *gmsgid, ...)
 {
   va_list ap;
   va_start (ap, gmsgid);
   rich_location richloc (line_table, input_location);
-  bool ret = diagnostic_impl (&richloc, opt, gmsgid, &ap, DK_WARNING);
+  diagnostic_impl (&richloc, opt, gmsgid, &ap, DK_WARNING);
   va_end (ap);
-  return ret;
 }
 
 /* A warning at LOCATION.  Use this for code which is correct according to the
    relevant language specification but is likely to be buggy anyway.
    Returns true if the warning was printed, false if it was inhibited.  */
 
-bool
+void
 warning_at (location_t location, int opt, const char *gmsgid, ...)
 {
   va_list ap;
   va_start (ap, gmsgid);
   rich_location richloc (line_table, location);
-  bool ret = diagnostic_impl (&richloc, opt, gmsgid, &ap, DK_WARNING);
+  diagnostic_impl (&richloc, opt, gmsgid, &ap, DK_WARNING);
   va_end (ap);
-  return ret;
 }
 
 /* Same as "warning at" above, but using RICHLOC.  */
 
-bool
+void
 warning_at (rich_location *richloc, int opt, const char *gmsgid, ...)
 {
   gcc_assert (richloc);
 
   va_list ap;
   va_start (ap, gmsgid);
-  bool ret = diagnostic_impl (richloc, opt, gmsgid, &ap, DK_WARNING);
+  diagnostic_impl (richloc, opt, gmsgid, &ap, DK_WARNING);
   va_end (ap);
-  return ret;
 }
 
 /* Same as warning_n plural variant below, but using RICHLOC.  */
 
-bool
+void
 warning_n (rich_location *richloc, int opt, unsigned HOST_WIDE_INT n,
 	   const char *singular_gmsgid, const char *plural_gmsgid, ...)
 {
@@ -1374,29 +1371,27 @@ warning_n (rich_location *richloc, int opt, unsigned HOST_WIDE_INT n,
 
   va_list ap;
   va_start (ap, plural_gmsgid);
-  bool ret = diagnostic_n_impl (richloc, opt, n,
-				singular_gmsgid, plural_gmsgid,
-				&ap, DK_WARNING);
+  diagnostic_n_impl (richloc, opt, n,
+		     singular_gmsgid, plural_gmsgid,
+		     &ap, DK_WARNING);
   va_end (ap);
-  return ret;
 }
 
 /* A warning at LOCATION.  Use this for code which is correct according to the
    relevant language specification but is likely to be buggy anyway.
    Returns true if the warning was printed, false if it was inhibited.  */
 
-bool
+void
 warning_n (location_t location, int opt, unsigned HOST_WIDE_INT n,
 	   const char *singular_gmsgid, const char *plural_gmsgid, ...)
 {
   va_list ap;
   va_start (ap, plural_gmsgid);
   rich_location richloc (line_table, location);
-  bool ret = diagnostic_n_impl (&richloc, opt, n,
-				singular_gmsgid, plural_gmsgid,
-				&ap, DK_WARNING);
+  diagnostic_n_impl (&richloc, opt, n,
+		     singular_gmsgid, plural_gmsgid,
+		     &ap, DK_WARNING);
   va_end (ap);
-  return ret;
 }
 
 /* A "pedantic" warning at LOCATION: issues a warning unless
@@ -1412,29 +1407,27 @@ warning_n (location_t location, int opt, unsigned HOST_WIDE_INT n,
 
    Returns true if the warning was printed, false if it was inhibited.  */
 
-bool
+void
 pedwarn (location_t location, int opt, const char *gmsgid, ...)
 {
   va_list ap;
   va_start (ap, gmsgid);
   rich_location richloc (line_table, location);
-  bool ret = diagnostic_impl (&richloc, opt, gmsgid, &ap, DK_PEDWARN);
+  diagnostic_impl (&richloc, opt, gmsgid, &ap, DK_PEDWARN);
   va_end (ap);
-  return ret;
 }
 
 /* Same as pedwarn above, but using RICHLOC.  */
 
-bool
+void
 pedwarn (rich_location *richloc, int opt, const char *gmsgid, ...)
 {
   gcc_assert (richloc);
 
   va_list ap;
   va_start (ap, gmsgid);
-  bool ret = diagnostic_impl (richloc, opt, gmsgid, &ap, DK_PEDWARN);
+  diagnostic_impl (richloc, opt, gmsgid, &ap, DK_PEDWARN);
   va_end (ap);
-  return ret;
 }
 
 /* A "permissive" error at LOCATION: issues an error unless
@@ -1444,29 +1437,27 @@ pedwarn (rich_location *richloc, int opt, const char *gmsgid, ...)
 
    Returns true if the warning was printed, false if it was inhibited.  */
 
-bool
+void
 permerror (location_t location, const char *gmsgid, ...)
 {
   va_list ap;
   va_start (ap, gmsgid);
   rich_location richloc (line_table, location);
-  bool ret = diagnostic_impl (&richloc, -1, gmsgid, &ap, DK_PERMERROR);
+  diagnostic_impl (&richloc, -1, gmsgid, &ap, DK_PERMERROR);
   va_end (ap);
-  return ret;
 }
 
 /* Same as "permerror" above, but at RICHLOC.  */
 
-bool
+void
 permerror (rich_location *richloc, const char *gmsgid, ...)
 {
   gcc_assert (richloc);
 
   va_list ap;
   va_start (ap, gmsgid);
-  bool ret = diagnostic_impl (richloc, -1, gmsgid, &ap, DK_PERMERROR);
+  diagnostic_impl (richloc, -1, gmsgid, &ap, DK_PERMERROR);
   va_end (ap);
-  return ret;
 }
 
 /* A hard error: the code is definitely ill-formed, and an object file
-- 
1.8.5.3

