From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by sourceware.org (Postfix) with ESMTPS id 3E2863858C2C for ; Thu, 14 Oct 2021 12:25:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3E2863858C2C Received: by mail-wr1-x436.google.com with SMTP id o20so18964201wro.3 for ; Thu, 14 Oct 2021 05:25:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:reply-to :mime-version:content-transfer-encoding; bh=Lm7SbNBp/Evm0mmPkgd4AJWHN3HFc/soAUCyB8tmCbc=; b=nEw71nosxNKUtBQDRl5vFORlztM55N5fBsenH3POjaAV8IsLj+Fx4XSEbD0cUtCpXR qIEx/u0TQFnDy12Gg+b6FZYRvDq+CC94qAGN3X4TW8iZ/lkbU5ruTmRMwnS/KN6dBifg uyVY/xaw8AGVCla9UxAW+qd9aWyiZAcG7o7N9qy4+diL9TbXw5dDx853H9EFjEckpNvR lSm9Zo46mwzReSvVHN8XSP2WMecnDDRIYAeKZP+XdskRFx/M7q227asQm/qcsz/Ujbq0 RAj+BIJy7ri+Y9dD3S2ZZAq1iUoyYNvbdN9Rb7zdNeaYHoFEtnkFKBs0S70999f9mk5s gLPw== X-Gm-Message-State: AOAM532oT0yZTH4Gy1CYwRWFAT+HrZJTyiLKBo4JGRi7jHwnXi7oz6SI 6p/FYeOok/ifyN1obwyzrSVccsMhhjMs4w== X-Google-Smtp-Source: ABdhPJwTryIX9R15kwj/hLuclmB4YoNeNjBX05yFJCrJLqFD/NyObsi0AqfIclbGN8ceWO/TvbhgNQ== X-Received: by 2002:a5d:6d8e:: with SMTP id l14mr6272281wrs.44.1634214314054; Thu, 14 Oct 2021 05:25:14 -0700 (PDT) Received: from localhost.localdomain (host81-138-1-83.in-addr.btopenworld.com. [81.138.1.83]) by smtp.gmail.com with ESMTPSA id o12sm2258120wrv.78.2021.10.14.05.25.13 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Oct 2021 05:25:13 -0700 (PDT) From: Iain Sandoe X-Google-Original-From: Iain Sandoe To: gcc-patches@gcc.gnu.org Subject: [pushed] Darwin: Update quotes in driver warning messages. Date: Thu, 14 Oct 2021 13:25:03 +0100 Message-Id: <20211014122503.28258-1-iain@sandoe.co.uk> X-Mailer: git-send-email 2.24.3 (Apple Git-128) Reply-To: iain@sandoe.co.uk MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2021 12:25:17 -0000 This adds some missing quotes around options and option argument terms in warning messages. Avoid contractions in warning messages. tested on x86_64 darwin, pushed to master, thanks Iain Signed-off-by: Iain Sandoe 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. --- 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, "% for % 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 % %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 -- 2.24.3 (Apple Git-128)