public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "daniel.marjamaki at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/66773] sign-compare warning for == and != are pretty useless
Date: Mon, 06 Jul 2015 23:06:00 -0000	[thread overview]
Message-ID: <bug-66773-4-Rqw1KZXris@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-66773-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #4 from Daniel Marjamäki <daniel.marjamaki at gmail dot com> ---
absolutely. there are often bugs in the boundaries.

well. I was hoping to get more optimistic response.

how about this.. imagine that we wrote a "possible division by zero" warning
for every integer division that uses a non-constant rhs. every warning where
rhs can't really be zero would be a false positive. That would be very noisy
imo.

imho the false positive rate should be similar here. If there is a comparison
'a == -1' and a is unsigned then this warning is useless if a can't be
0xffffffff. if a has arbitrary values then statistically it's as likely that a
is 0xffffffff and 0. So I guess the false positive rate is somewhat similar.

Maybe the message can be tweaked?

comparison between signed and unsigned integer expressions [-Wsign-compare]

I think this message is fine for relational comparisons. A sign-cast is a
reasonable solution.

For == and != I am afraid the message is somewhat misleading. A sign-cast is
not a good solution.
>From gcc-bugs-return-491611-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Jul 07 00:37:47 2015
Return-Path: <gcc-bugs-return-491611-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 94939 invoked by alias); 7 Jul 2015 00:37:47 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 94907 invoked by uid 48); 7 Jul 2015 00:37:44 -0000
From: "dmalcolm at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug jit/66783] New: No error-checking for creating structs containing opaque structs
Date: Tue, 07 Jul 2015 00:37:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: jit
X-Bugzilla-Version: 6.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: dmalcolm at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: dmalcolm at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter blocked target_milestone
Message-ID: <bug-66783-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-07/txt/msg00501.txt.bz2
Content-length: 757

https://gcc.gnu.org/bugzilla/show_bug.cgi?idf783

            Bug ID: 66783
           Summary: No error-checking for creating structs containing
                    opaque structs
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: jit
          Assignee: dmalcolm at gcc dot gnu.org
          Reporter: dmalcolm at gcc dot gnu.org
            Blocks: 66627
  Target Milestone: ---

Problem reported on mailing list here:
  https://gcc.gnu.org/ml/jit/2015-q3/msg00022.html

We need to reject this kind of thing at the API boundary.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?idf627
[Bug 66627] Tracker bug for jit bugs affecting ravi


  parent reply	other threads:[~2015-07-06 23:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-06  8:46 [Bug c/66773] New: " daniel.marjamaki at gmail dot com
2015-07-06 17:00 ` [Bug c/66773] " segher at gcc dot gnu.org
2015-07-06 18:23 ` daniel.marjamaki at gmail dot com
2015-07-06 23:06 ` daniel.marjamaki at gmail dot com [this message]
2015-07-07  6:50 ` schwab@linux-m68k.org
2021-11-13 10:08 ` egallager 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-66773-4-Rqw1KZXris@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).