All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: "Junio C Hamano" <gitster@pobox.com>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	git@vger.kernel.org, "Jim Meyering" <jim@meyering.net>,
	"Fredrik Gustafsson" <iveqy@iveqy.com>,
	"Andreas Schwab" <schwab@linux-m68k.org>
Subject: Re: [PATCH 3/3] grep: get rid of useless x < 0 comparison on an enum member
Date: Mon, 07 Nov 2011 13:48:49 -0800	[thread overview]
Message-ID: <7vd3d31u4e.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <20111107213219.GA13537@elie.hsd1.il.comcast.net> (Jonathan Nieder's message of "Mon, 7 Nov 2011 15:32:19 -0600")

Jonathan Nieder <jrnieder@gmail.com> writes:

> So, the purpose of this patch was to work around this common bug in
> static analyzers.

I fail to see how it could be even considered a work around.

If you do not use static analyzers, you do not have to do such a change,
and the resulting code would (not the "negative" side, but the "positive"
side) catch real bugs when somebody screwes up and stuffs a bogus oob
value in p->field.

With the removal of the check, you _have_ to rely on static analyzers to
do the _right thing_, but if you have static analyzers that do the right
thing, you do not have to have such a workaround to begin with.

  reply	other threads:[~2011-11-07 21:48 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-06 12:06 [PATCH 0/3] Fix code issues spotted by clang Ævar Arnfjörð Bjarmason
2011-11-06 12:06 ` [PATCH 1/3] apply: get rid of useless x < 0 comparison on a size_t type Ævar Arnfjörð Bjarmason
2011-11-06 18:35   ` Junio C Hamano
2011-11-07 19:09     ` Giuseppe Bilotta
2011-11-06 12:06 ` [PATCH 2/3] diff/apply: cast variable in call to free() Ævar Arnfjörð Bjarmason
2011-11-06 12:06 ` [PATCH 3/3] grep: get rid of useless x < 0 comparison on an enum member Ævar Arnfjörð Bjarmason
2011-11-06 15:03   ` Andreas Schwab
2011-11-07 12:42     ` Ævar Arnfjörð Bjarmason
2011-11-07 13:12       ` Andreas Schwab
2011-11-07 16:38         ` Jeff King
2011-11-07 18:24           ` Andreas Schwab
2011-11-07 18:34             ` Jeff King
2011-11-07 18:55               ` Jeff King
2011-11-07 19:06                 ` Ævar Arnfjörð Bjarmason
2011-11-07 20:13                 ` Andreas Schwab
2011-11-07 19:49   ` Jonathan Nieder
2011-11-07 21:18     ` Junio C Hamano
2011-11-07 21:32       ` Jonathan Nieder
2011-11-07 21:48         ` Junio C Hamano [this message]
2011-11-07 22:21           ` Jonathan Nieder
2011-11-06 12:33 ` [PATCH 0/3] Fix code issues spotted by clang Ævar Arnfjörð Bjarmason
2011-11-08 16:05   ` Elijah Newren

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=7vd3d31u4e.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=iveqy@iveqy.com \
    --cc=jim@meyering.net \
    --cc=jrnieder@gmail.com \
    --cc=schwab@linux-m68k.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.