From: Pierre Habouzit <madcoder@debian.org>
To: git@vger.kernel.org
Subject: Re: [PATCH] Fix a comparison bug in diff-delta.c
Date: Wed, 23 Aug 2006 04:38:02 +0200 [thread overview]
Message-ID: <200608230438.06053.madcoder@debian.org> (raw)
In-Reply-To: <1156300368160-git-send-email-madcoder@debian.org>
[-- Attachment #1: Type: text/plain, Size: 993 bytes --]
Le mer 23 août 2006 04:32, Pierre Habouzit a écrit :
> I'm currently trying to make git compile with more strict gcc flags
> (-g -O2 -Wall -Wextra -Wno-unused -Werror to be precise) and I've
> spotted a first bug due to a signed/unsigned comparison.
still in the same kind of "problems" sha1_name.c:512 has:
if (active_nr < 0)
return -1;
but active_nr is defined as an unsigned (in cache.h/cache-read.c).
Also note that there is a *lot* of signed/unsigned comparisons due to
the fact that it's unsigned, and that it's often compared to positions
that are ints (I assume pos need the negative values to mean "error").
so either those two lines are too much, or active_nr has to be a plain
signed int. I'm not used to git sources enough yet to be able to make
the right decision.
--
·O· Pierre Habouzit
··O madcoder@debian.org
OOO http://www.madism.org
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2006-08-23 2:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-23 2:32 [PATCH] Fix a comparison bug in diff-delta.c Pierre Habouzit
2006-08-23 2:38 ` Pierre Habouzit [this message]
2006-08-23 3:17 ` Nicolas Pitre
-- strict thread matches above, loose matches on Subject: below --
2006-08-23 9:17 Pierre Habouzit
2006-08-23 13:45 ` Johannes Schindelin
2006-08-23 14:31 ` Pierre Habouzit
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=200608230438.06053.madcoder@debian.org \
--to=madcoder@debian.org \
--cc=git@vger.kernel.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 NNTP newsgroup(s).