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: Wed, 23 Aug 2017 15:37:48 +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 #11 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, master has been updated
via 376b40a27a6783ea7f73ae577be320df66aeb36d (commit)
from 2b0b9a1c85ea93a64e55bb369e79758195512fc2 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=376b40a27a6783ea7f73ae577be320df66aeb36d
commit 376b40a27a6783ea7f73ae577be320df66aeb36d
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Wed Aug 23 08:22:52 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.
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 9 ++
string/stratcliff.c | 276 +++++++++++++++++++++++++++++++--------------------
2 files changed, 176 insertions(+), 109 deletions(-)
--
You are receiving this mail because:
You are on the CC list for the bug.