public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "segher at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/104711] Unnecessary -Wshift-negative-value warning
Date: Sun, 27 Feb 2022 22:37:08 +0000	[thread overview]
Message-ID: <bug-104711-4-qG81aHUwow@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-104711-4@http.gcc.gnu.org/bugzilla/>

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

Segher Boessenkool <segher at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2022-02-27
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

--- Comment #2 from Segher Boessenkool <segher at gcc dot gnu.org> ---
Our documentation says in
<https://gcc.gnu.org/onlinedocs/gcc/Integers-implementation.html>

  As an extension to the C language, GCC does not use the latitude given in C99
  and C11 only to treat certain aspects of signed ‘<<’ as undefined. However,
  -fsanitize=shift (and -fsanitize=undefined) will diagnose such cases. They
are
  also diagnosed where constant expressions are required.

It would be much saner / much more practical if we actually implemented this,
i.e. don't have -Wshift-negative-value in -Wextra (the above text does not make
much sense if that was the design!)

This warning does have a good enough balance between amount of false positives,
detection of serious problems, and usefulness to be included in -Wextra.  The
considerations for -Wall and -W are exactly the same, just the bar is lower for
the latter.

Confirmed.

  parent reply	other threads:[~2022-02-27 22:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-27 21:27 [Bug c/104711] New: " arnd at linaro dot org
2022-02-27 21:40 ` [Bug c/104711] " pinskia at gcc dot gnu.org
2022-02-27 22:37 ` segher at gcc dot gnu.org [this message]
2022-02-27 22:38 ` segher at gcc dot gnu.org
2022-02-27 22:42 ` segher at gcc dot gnu.org
2022-03-01  7:58 ` rguenth at gcc dot gnu.org
2022-03-01  9:07 ` jakub at gcc dot gnu.org
2022-03-01 14:11 ` jakub at gcc dot gnu.org
2022-03-01 17:51 ` segher at gcc dot gnu.org
2022-03-09  8:16 ` cvs-commit at gcc dot gnu.org
2022-03-29  5:53 ` cvs-commit at gcc dot gnu.org
2022-05-10  8:25 ` cvs-commit at gcc dot gnu.org
2022-05-11  6:25 ` cvs-commit at gcc dot gnu.org
2022-05-11  6:36 ` jakub 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-104711-4-qG81aHUwow@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).