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 #6 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  350277b80006b465158cef775f33098791c68f83 (commit)

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=350277b80006b465158cef775f33098791c68f83

commit 350277b80006b465158cef775f33098791c68f83
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.

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

-- 
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]