From: Frank Lichtenheld <frank@lichtenheld.de>
To: Git Mailing List <git@vger.kernel.org>
Subject: [Bug?] compiler warning with gcc >= 4.2
Date: Tue, 3 Jul 2007 14:58:44 +0200 [thread overview]
Message-ID: <20070703125844.GL12721@planck.djpig.de> (raw)
Hi,
while testing for an (probably) unrelated miscompilation bug,
I got the following warning while compiling git:
gcc-4.2 -o sha1_file.o -c -g -O2 -Wall -DSHA1_HEADER='<openssl/sha.h>'
-DETC_GITCONFIG='"/home/djpig/etc/gitconfig"' -DNO_STRLCPY sha1_file.c
sha1_file.c: In function ‘check_packed_git_idx’:
sha1_file.c:523: warning: assuming signed overflow does not occur when assuming that (X + c) < X is always false
sha1_file.c:523: warning: assuming signed overflow does not occur when assuming that (X + c) < X is always false
This comes from the new -Wstrict-overflow which warns about the fact
that with -fstrict-overflow, which is activated by default with -O2,
the if clause referenced in the warning will be optimised away.
So I would be interested to know
a) if the compiler optimising this check away (which seems to be a check
about whether signed overflow can occour) can lead to unwanted results
b) if not a), if it would make sense trying to suppress that warning, so
that other people don't end up wondering the same as me
The used compiler was:
$ gcc-4.2 -v
Using built-in specs.
Target: hppa-linux-gnu
Configured with: ../src/configure -v
--enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr
--enable-shared --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --enable-nls
--with-gxx-include-dir=/usr/include/c++/4.2 --program-suffix=-4.2
--enable-clocale=gnu --enable-libstdcxx-debug --enable-mpfr
--disable-libssp --disable-werror --enable-checking=release
--build=hppa-linux-gnu --host=hppa-linux-gnu
--target=hppa-linux-gnuThread model: posix
gcc version 4.2.1 20070627 (prerelease) (Debian 4.2-20070627-1)
Gruesse,
--
Frank Lichtenheld <frank@lichtenheld.de>
www: http://www.djpig.de/
next reply other threads:[~2007-07-03 12:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-03 12:58 Frank Lichtenheld [this message]
2007-07-03 14:18 ` [Bug?] compiler warning with gcc >= 4.2 Nicolas Pitre
2007-07-06 8:55 ` Jan Hudec
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=20070703125844.GL12721@planck.djpig.de \
--to=frank@lichtenheld.de \
--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).