[3/12] fix diagnostic quoting/spelling in Brig

Message ID c4299dad-f27b-46e0-f3b9-3953fbe52efc@gmail.com
State New
Headers show
Series
  • detect quoting and punctuation problems in diagnostics
Related show

Commit Message

Martin Sebor May 14, 2019, 9:32 p.m.
The attached patch fixes quoting, spelling, and other formatting
issues in diagnostics issued by the Brig front end and pointed
out by the -Wformat-diag warning.

Martin

Comments

Jeff Law May 16, 2019, 7:12 p.m. | #1
On 5/14/19 3:32 PM, Martin Sebor wrote:
> The attached patch fixes quoting, spelling, and other formatting

> issues in diagnostics issued by the Brig front end and pointed

> out by the -Wformat-diag warning.

> 

> Martin

> 

> gcc-wformat-diag-brig.diff

> 

> gcc/brig/ChangeLog:

> 

> 	* brigfrontend/brig-control-handler.cc

> 	(brig_directive_control_handler::operator): Remove trailing newline

> 	from a diagnostic.

> 	* brigfrontend/brig-module-handler.cc

> 	(brig_directive_module_handler::operator): Remove a duplicated space

> 	from a diagnostic.

OK.
Jeff

Patch

gcc/brig/ChangeLog:

	* brigfrontend/brig-control-handler.cc
	(brig_directive_control_handler::operator): Remove trailing newline
	from a diagnostic.
	* brigfrontend/brig-module-handler.cc
	(brig_directive_module_handler::operator): Remove a duplicated space
	from a diagnostic.

diff --git a/gcc/brig/brigfrontend/brig-control-handler.cc b/gcc/brig/brigfrontend/brig-control-handler.cc
index 38039315c7c..4374c469a39 100644
--- a/gcc/brig/brigfrontend/brig-control-handler.cc
+++ b/gcc/brig/brigfrontend/brig-control-handler.cc
@@ -102,7 +102,7 @@  brig_directive_control_handler::operator () (const BrigBase *base)
       /* Unimplemented.  */
       break;
     default:
-      sorry ("Unsupported control directive %x.\n", inst->control);
+      sorry ("Unsupported control directive %x.", inst->control);
     }
   return base->byteCount;
 }
diff --git a/gcc/brig/brigfrontend/brig-module-handler.cc b/gcc/brig/brigfrontend/brig-module-handler.cc
index 58a65d65574..e1551b93812 100644
--- a/gcc/brig/brigfrontend/brig-module-handler.cc
+++ b/gcc/brig/brigfrontend/brig-module-handler.cc
@@ -28,10 +28,10 @@  brig_directive_module_handler::operator () (const BrigBase *base)
   const BrigDirectiveModule* mod = (const BrigDirectiveModule*)base;
   m_parent.m_module_name = m_parent.get_string (mod->name).substr (1);
   if (mod->hsailMajor != 1 || mod->hsailMinor != 0)
-    fatal_error (UNKNOWN_LOCATION, PHSA_ERROR_PREFIX_INCOMPATIBLE_MODULE " "
+    fatal_error (UNKNOWN_LOCATION, PHSA_ERROR_PREFIX_INCOMPATIBLE_MODULE
 		 "HSAIL version not supported. HSAIL 1.0 required.");
   if (mod->machineModel != BRIG_MACHINE_LARGE)
-    fatal_error (UNKNOWN_LOCATION, PHSA_ERROR_PREFIX_INCOMPATIBLE_MODULE " "
+    fatal_error (UNKNOWN_LOCATION, PHSA_ERROR_PREFIX_INCOMPATIBLE_MODULE
 		 "Only HSA 'large' machine model supported.");
   /* Do not check for the profile as the runtime conformance suite tests
      with 'full' profile BRIGs even though they don't use any full profile