public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Martin Sebor <msebor@gmail.com>
To: Franz Sirl <Franz.Sirl-kernel@lauterbach.com>,
	Gcc Patch List <gcc-patches@gcc.gnu.org>
Subject: Re: committed: remove redundant -Wall from -Warray-bounds (PR 82063)
Date: Tue, 24 Jul 2018 15:36:00 -0000	[thread overview]
Message-ID: <f81ba1d2-1d7e-5bda-4d04-a74664a582b3@gmail.com> (raw)
In-Reply-To: <841b9a52-060e-5a16-28da-aec967a65277@lauterbach.com>

On 07/24/2018 03:24 AM, Franz Sirl wrote:
> Am 2018-07-20 um 23:22 schrieb Martin Sebor:
>> As the last observation in PR 82063 Jim points out that
>>
>>    Both -Warray-bounds and -Warray-bounds= are listed in the c.opt
>>    file as being enabled by -Wall, but they are the same option,
>>    and it causes this one option to be processed twice in the
>>    C_handle_option_auto function in the generated options.c file.
>>    It gets set to the same value twice, so it does work as intended,
>>    but this is wasteful.
>>
>> I have removed the redundant -Wall from the first option and
>> committed the change as obvious in r262912.
>
> Hi Martin,
>
> this looks related to PR 68845 and my patch in there. I never posted it
> to gcc-patches because I couldn't find a definitive answer on how
> options duplicated between common.opt and c-family/c.opt are supposed to
> be handled.
> For example, Warray-bounds in common.opt is a separate option (not an
> alias to Warray-bounds=), leading to separate enums for them. Is this
> intended? Warray-bounds seemed to be the only option with an equal sign
> doing it like that at that time. Now Wcast-align is doing the same...
>
> Can you shed some light on this?

-Warray-bounds= (the form that takes an argument) was added in
r219577.  Before then, only the plain form existed.  If I had
to guess, the interplay between the two options (as opposed to
making the latter an alias for the new option) wasn't considered.
I didn't think of it until now either.  Your patch seems like
the right solution to me.  Let me know if you will submit it.
If not, I posted the patch below that touches this area and
that will likely need updating so I can roll your change into
it:

https://gcc.gnu.org/ml/gcc-patches/2018-07/msg01286.html

Martin

  reply	other threads:[~2018-07-24 15:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-20 21:22 Martin Sebor
2018-07-24  9:24 ` Franz Sirl
2018-07-24 15:36   ` Martin Sebor [this message]
2018-07-24 19:48     ` Franz Sirl
2018-07-24 20:18       ` Martin Sebor
2022-03-29  9:23 ` options: Remove 'gcc/c-family/c.opt:Warray-bounds' option definition record (was: committed: remove redundant -Wall from -Warray-bounds (PR 82063)) Thomas Schwinge
2022-03-29 18:00   ` Joseph Myers

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=f81ba1d2-1d7e-5bda-4d04-a74664a582b3@gmail.com \
    --to=msebor@gmail.com \
    --cc=Franz.Sirl-kernel@lauterbach.com \
    --cc=gcc-patches@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).