public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-4394] Darwin: Update quotes in driver warning messages.
@ 2021-10-14 12:22 Iain D Sandoe
  0 siblings, 0 replies; only message in thread
From: Iain D Sandoe @ 2021-10-14 12:22 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:d67b22e7315ca7ecfcf5e5ec3d401285d7ea25b5

commit r12-4394-gd67b22e7315ca7ecfcf5e5ec3d401285d7ea25b5
Author: Iain Sandoe <iain@sandoe.co.uk>
Date:   Sun Mar 28 20:50:09 2021 +0100

    Darwin: Update quotes in driver warning messages.
    
    This adds some missing quotes around options and option argument
    terms in warning messages.  Avoid contractions in warning
    messages.
    
    Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
    
    gcc/ChangeLog:
    
            * config/darwin-driver.c (darwin_find_version_from_kernel):
            Quote internal identifiers and avoid contractions in
            warnings.
            (darwin_default_min_version): Likewise.
            (darwin_driver_init): Likewise.

Diff:
---
 gcc/config/darwin-driver.c | 52 ++++++++++++++++++++++++++--------------------
 1 file changed, 30 insertions(+), 22 deletions(-)

diff --git a/gcc/config/darwin-driver.c b/gcc/config/darwin-driver.c
index 3d7768f055d..573abae4782 100644
--- a/gcc/config/darwin-driver.c
+++ b/gcc/config/darwin-driver.c
@@ -143,7 +143,7 @@ darwin_find_version_from_kernel (void)
   if (sysctl (osversion_name, ARRAY_SIZE (osversion_name), osversion,
 	      &osversion_len, NULL, 0) == -1)
     {
-      warning (0, "sysctl for kern.osversion failed: %m");
+      warning (0, "%<sysctl%> for %<kern.osversion%> failed: %m");
       return NULL;
     }
 
@@ -189,7 +189,7 @@ darwin_find_version_from_kernel (void)
   return new_flag;
 
  parse_failed:
-  warning (0, "couldn%'t understand kern.osversion %q.*s",
+  warning (0, "could not understand %<kern.osversion%> %q.*s",
 	   (int) osversion_len, osversion);
   return NULL;
 }
@@ -229,7 +229,7 @@ darwin_default_min_version (void)
       const char *checked = validate_macosx_version_min (new_flag);
       if (checked == NULL)
 	{
-	  warning (0, "could not understand version %s", new_flag);
+	  warning (0, "could not understand version %qs", new_flag);
 	  return NULL;
 	}
       new_flag = xstrndup (checked, strlen (checked));
@@ -305,7 +305,7 @@ darwin_driver_init (unsigned int *decoded_options_count,
 	  else if (!strcmp ((*decoded_options)[i].arg, "ppc64"))
 	    seenPPC64 = true;
 	  else
-	    error ("this compiler does not support %s",
+	    error ("this compiler does not support %qs",
 		   (*decoded_options)[i].arg);
 	  /* Now we've examined it, drop the -arch arg.  */
 	  if (*decoded_options_count > i) {
@@ -377,45 +377,53 @@ darwin_driver_init (unsigned int *decoded_options_count,
   /* Turn -arch xxxx into the appropriate -m32/-m64 flag.
      If the User tried to specify multiple arch flags (which is possible with
      some Darwin compilers) warn that this mode is not supported by this
-     compiler (and ignore the arch flags, which means that the default multi-
-     lib will be generated).  */
+     compiler.  We take arch specifiers that agree with the default multilib
+     as the first choice and reject others.  */
   /* TODO: determine if these warnings would better be errors.  */
 #if DARWIN_X86
   if (seenPPC || seenPPC64)
-    warning (0, "this compiler does not support PowerPC (arch flags ignored)");
+    warning (0, "this compiler does not support PowerPC"
+		" (%<-arch%> option ignored)");
   if (seenX86)
     {
       if (seenX86_64 || seenM64)
-	warning (0, "%s conflicts with i386 (arch flags ignored)",
-	        (seenX86_64? "x86_64": "m64"));
-      else if (! seenM32) /* Add -m32 if the User didn't. */
+	{
+	  const char *op = (seenX86_64? "-arch x86_64": "-m64");
+	  warning (0, "%qs conflicts with %<-arch i386%> (%qs ignored)",
+		   op, op);
+	}
+      if (! seenM32) /* Add -m32 if the User didn't. */
 	appendM32 = true;
     }
   else if (seenX86_64)
     {
-      if (seenX86 || seenM32)
-	warning (0, "%s conflicts with x86_64 (arch flags ignored)",
-		 (seenX86? "i386": "m32"));
-      else if (! seenM64) /* Add -m64 if the User didn't. */
+      if (seenM32)
+	warning (0, "%<-m32%> conflicts with %<-arch x86_64%>"
+		    " (%<-m32%> ignored)");
+      if (! seenM64) /* Add -m64 if the User didn't. */
 	appendM64 = true;
     }  
 #elif DARWIN_PPC
   if (seenX86 || seenX86_64)
-    warning (0, "this compiler does not support X86 (arch flags ignored)");
+    warning (0, "this compiler does not support x86"
+		" (%<-arch%> option ignored)");
   if (seenPPC)
     {
       if (seenPPC64 || seenM64)
-	warning (0, "%s conflicts with ppc (arch flags ignored)",
-		 (seenPPC64? "ppc64": "m64"));
-      else if (! seenM32) /* Add -m32 if the User didn't. */
+	{
+	  const char *op = (seenPPC64? "-arch ppc64": "-m64");
+	  warning (0, "%qs conflicts with %<-arch ppc%> (%qs ignored)",
+		   op, op);
+	}
+      if (! seenM32) /* Add -m32 if the User didn't. */
 	appendM32 = true;
     }
   else if (seenPPC64)
     {
-      if (seenPPC || seenM32)
-	warning (0, "%s conflicts with ppc64 (arch flags ignored)",
-		 (seenPPC? "ppc": "m32"));
-      else if (! seenM64) /* Add -m64 if the User didn't. */
+      if (seenM32)
+	warning (0, "%<-m32%> conflicts with %<-arch ppc64%>"
+		    " (%<-m32%> ignored)");
+      if (! seenM64) /* Add -m64 if the User didn't. */
 	appendM64 = true;
     }
 #endif


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-10-14 12:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-14 12:22 [gcc r12-4394] Darwin: Update quotes in driver warning messages Iain D Sandoe

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).