public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Joseph Myers <joseph@codesourcery.com>
To: Marek Polacek <polacek@redhat.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>, Jason Merrill <jason@redhat.com>
Subject: Re: [C/C++ PATCH] Implement -Wshift-overflow (PR c++/55095) (take 3)
Date: Thu, 04 Jun 2015 21:05:00 -0000	[thread overview]
Message-ID: <alpine.DEB.2.10.1506042103560.6208@digraph.polyomino.org.uk> (raw)
In-Reply-To: <20150603130531.GF2756@redhat.com>

On Wed, 3 Jun 2015, Marek Polacek wrote:

> > Well, ok then.  This new version incorporates Richard S.'s suggestion,
> > and warns even for 1 << 31 in C99/C11 (also in C90 when -Wshift-overflow
> > is explicitely specified).  For C++, it warns about 1 << 31 by default
> > only in C++11 mode, in C++14 never, otherwise only if -Wshift-overflow
> > is specified.
> > 
> > But the fallout seems to be nonnegligible.  So I think the default should
> > be -Wshift-overflow=1 that doesn't warn about 1 << 31, but still rejects
> > e.g. enum { A = 1 << 31 };.  And -Wshift-overflow=2 would warn even about
> > 1 << 31.  (Perhaps this is exactly what you had in mind, but I'm not sure.)
> 
> Done in the following.  I think this is the best approach.  The documentation
> hopefully makes it clear what's the intended behavior.
> 
> Bootstrapped/regtested on x86_64-linux, ok for trunk?

The C changes are OK.

-- 
Joseph S. Myers
joseph@codesourcery.com

  reply	other threads:[~2015-06-04 21:04 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-25 20:12 [C/C++ PATCH] Implement -Wshift-overflow (PR c++/55095) Marek Polacek
2015-05-26 11:07 ` Marek Polacek
2015-05-29 21:25 ` Joseph Myers
2015-06-02 19:26   ` [C/C++ PATCH] Implement -Wshift-overflow (PR c++/55095) (take 2) Marek Polacek
2015-06-03 13:07     ` [C/C++ PATCH] Implement -Wshift-overflow (PR c++/55095) (take 3) Marek Polacek
2015-06-04 21:05       ` Joseph Myers [this message]
2015-06-05  9:42         ` Marek Polacek
2015-06-12  9:08           ` Marek Polacek
2015-06-19 10:51             ` Marek Polacek
2015-06-26  8:36               ` Marek Polacek
2015-07-03  7:42                 ` Marek Polacek
2015-07-10 13:23                   ` Marek Polacek
2015-07-17  8:32                     ` Marek Polacek
2015-07-17 23:01                       ` Jeff Law
2015-07-20 14:19                         ` Marek Polacek
2015-06-01 20:06 ` [C/C++ PATCH] Implement -Wshift-overflow (PR c++/55095) Richard Sandiford
2015-06-02  8:16   ` Richard Biener
2015-06-02  9:01     ` Richard Sandiford
2015-06-02 15:05       ` Marek Polacek
2015-07-20 20:40 [C/C++ PATCH] Implement -Wshift-overflow (PR c++/55095) (take 3) David Edelsohn
2015-07-21 10:11 ` Marek Polacek
2015-07-22 12:48   ` David Edelsohn
2015-07-22 12:51     ` Marek Polacek
2015-07-22 12:52       ` Segher Boessenkool
2015-07-22 17:01         ` Marek Polacek

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=alpine.DEB.2.10.1506042103560.6208@digraph.polyomino.org.uk \
    --to=joseph@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jason@redhat.com \
    --cc=polacek@redhat.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).