This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug string/21982] stratcliff.c: error: assuming signed overflow does not occur with -O3


https://sourceware.org/bugzilla/show_bug.cgi?id=21982

--- Comment #15 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, release/2.25/master has been updated
       via  4e4cfd77617c190a7c8b3f83c41e1ad0771bd569 (commit)
      from  e0252d3c64f2f4f7f0f551815d304d864d7f68cd (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=4e4cfd77617c190a7c8b3f83c41e1ad0771bd569

commit 4e4cfd77617c190a7c8b3f83c41e1ad0771bd569
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Mon Sep 11 08:51: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.

    (cherry picked from commit 376b40a27a6783ea7f73ae577be320df66aeb36d)

-----------------------------------------------------------------------

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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]