public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Alexander Monakov <amonakov@ispras.ru>
To: Richard Biener <richard.guenther@gmail.com>
Cc: gcc@gcc.gnu.org, David Malcolm <dmalcolm@redhat.com>
Subject: Re: Separate warning/error thresholds for -Wfoo=<n>
Date: Tue, 6 Dec 2022 19:43:56 +0300 (MSK)	[thread overview]
Message-ID: <59ec7613-5e6-23a8-c4bc-e9381edf3a59@ispras.ru> (raw)
In-Reply-To: <CAFiYyc0ctdyP7eZTdcP-JyVoDFZpxHGsGYkO9AAbqjArrf8cFw@mail.gmail.com>


On Tue, 6 Dec 2022, Richard Biener via Gcc wrote:

> Implementation-wise one could do a similar trick as we have for
> global_options vs. global_options_set - add a global_options_error copy (ick!)
> (and global_options_error_set!?) and have the logic that decides whether
> a warning is an error pick that set.  Of course it's the actual pass that looks
> at flag_xyz which holds the magic number so that pass would need to be able
> to see whether it needs to look at both numbers.

I'm hoping to come up with a reasonably elegant way to implement this.

> Btw, does '-Werror=array-bounds=2' imply that =1 kinds are diagnosed as
> warning?

No, =1 kinds are diagnosed as error as well.

> Does it enable -Warray-bounds=2?

Yes, -Werror=array-bounds=2 is simply decomposed into -Warray-bounds=2
-Werror=array-bounds= (since PR 48088 was fixed).

> I think the DWIM behavior isn't all that clear and probably depends on the
> actual option we want to make it work.

Yeah, I guess there will be differences of opinion here, and I'm interested
to reach community consensus. Let's say I'm mostly interested in supporting

  -Warray-bounds=2 -Werror=array-bounds=1

(errors for most certain OOB accesses, warnings otherwise).

Alexander

      reply	other threads:[~2022-12-06 16:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-06 15:52 Alexander Monakov
2022-12-06 16:18 ` Richard Biener
2022-12-06 16:43   ` Alexander Monakov [this message]

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=59ec7613-5e6-23a8-c4bc-e9381edf3a59@ispras.ru \
    --to=amonakov@ispras.ru \
    --cc=dmalcolm@redhat.com \
    --cc=gcc@gcc.gnu.org \
    --cc=richard.guenther@gmail.com \
    /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).