This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug string/21982] stratcliff.c: error: assuming signed overflow does not occur with -O3
- From: "cvs-commit at gcc dot gnu.org" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Tue, 22 Aug 2017 12:36:01 +0000
- Subject: [Bug string/21982] stratcliff.c: error: assuming signed overflow does not occur with -O3
- Auto-submitted: auto-generated
- References: <bug-21982-131@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=21982
--- Comment #8 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, hjl/pr21982/master has been created
at f951e4aa927efdf3112be92006b11d31cb75ef2b (commit)
- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=f951e4aa927efdf3112be92006b11d31cb75ef2b
commit f951e4aa927efdf3112be92006b11d31cb75ef2b
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Sun Aug 20 10:11:38 2017 -0700
string/stratcliff.c: Replace int with size_t [BZ #21982]
Fix GCC 7 errors when string/stratcliff.c is compiled with -O3:
stratcliff.c: In function ‘do_test’:
cc1: error: assuming signed overflow does not occur when assuming that (X -
c) <= X is always true [-Werror=strict-overflow]
[BZ #21982]
* string/stratcliff.c (do_test): Declare size, nchars, inner,
middle and outer with size_t instead of int. Repleace %d and
%Zd with %zu in printf. Update "MAX (0, nchars - 128)" and
"MAX (outer, nchars - 64)" to support unsigned outer and
nchars. Also exit loop when outer == 0.
-----------------------------------------------------------------------
--
You are receiving this mail because:
You are on the CC list for the bug.