public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "xry111 at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug other/114980] [14/15 Regression] -fdiagnostics-urls=never does not suppress URLs in `'-Werror=' argument '-Werror=...' not valid for ...` warnings
Date: Wed, 08 May 2024 03:21:22 +0000	[thread overview]
Message-ID: <bug-114980-4-UEK17Zm1jx@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-114980-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114980

Xi Ruoyao <xry111 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2024-05-08
           Assignee|unassigned at gcc dot gnu.org      |xry111 at gcc dot gnu.org
             Status|UNCONFIRMED                 |ASSIGNED
     Ever confirmed|0                           |1

--- Comment #7 from Xi Ruoyao <xry111 at gcc dot gnu.org> ---
Patch only tested barely:

diff --git a/gcc/opts-common.cc b/gcc/opts-common.cc
index 4a2dff243b0..2d1e86ff94f 100644
--- a/gcc/opts-common.cc
+++ b/gcc/opts-common.cc
@@ -1152,6 +1152,7 @@ prune_options (struct cl_decoded_option
**decoded_options,
   unsigned int options_to_prepend = 0;
   unsigned int Wcomplain_wrong_lang_idx = 0;
   unsigned int fdiagnostics_color_idx = 0;
+  unsigned int fdiagnostics_urls_idx = 0;

   /* Remove arguments which are negated by others after them.  */
   new_decoded_options_count = 0;
@@ -1185,6 +1186,12 @@ prune_options (struct cl_decoded_option
**decoded_options,
            ++options_to_prepend;
          fdiagnostics_color_idx = i;
          continue;
+       case OPT_fdiagnostics_urls_:
+         gcc_checking_assert (i != 0);
+         if (fdiagnostics_urls_idx == 0)
+           ++options_to_prepend;
+         fdiagnostics_urls_idx = i;
+         continue;

        default:
          gcc_assert (opt_idx < cl_options_count);
@@ -1248,6 +1255,12 @@ keep:
            = old_decoded_options[fdiagnostics_color_idx];
          new_decoded_options_count++;
        }
+      if (fdiagnostics_urls_idx != 0)
+       {
+         new_decoded_options[argv_0 + options_prepended++]
+           = old_decoded_options[fdiagnostics_urls_idx];
+         new_decoded_options_count++;
+       }
       gcc_checking_assert (options_to_prepend == options_prepended);
     }

  parent reply	other threads:[~2024-05-08  3:21 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-08  2:39 [Bug other/114980] New: " xry111 at gcc dot gnu.org
2024-05-08  2:47 ` [Bug other/114980] " xry111 at gcc dot gnu.org
2024-05-08  2:49 ` pinskia at gcc dot gnu.org
2024-05-08  2:50 ` xry111 at gcc dot gnu.org
2024-05-08  2:52 ` pinskia at gcc dot gnu.org
2024-05-08  2:56 ` xry111 at gcc dot gnu.org
2024-05-08  2:58 ` xry111 at gcc dot gnu.org
2024-05-08  3:21 ` xry111 at gcc dot gnu.org [this message]
2024-05-08  3:25 ` [Bug driver/114980] " xry111 at gcc dot gnu.org
2024-05-08  5:58 ` xry111 at gcc dot gnu.org
2024-05-08  8:20 ` rguenth at gcc dot gnu.org
2024-05-10  3:20 ` cvs-commit at gcc dot gnu.org
2024-05-10  3:21 ` cvs-commit at gcc dot gnu.org
2024-05-10  3:22 ` xry111 at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-114980-4-UEK17Zm1jx@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).