Skip to content
Commit 4e4cfd77 authored by H.J. Lu's avatar H.J. Lu
Browse files

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 376b40a2)
parent e0252d3c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment