From 828d5c50aeb3ad9ab508db5e1af97609e8b244df Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 21 May 2022 13:38:29 -0700 Subject: [PATCH] strstr-simple: pacify GCC 12.1 * lib/str-two-way.h (two_way_long_needle): Pacify GCC 12.1 -Wsuggest-attribute=pure (x86-64, -O2). --- ChangeLog | 6 ++++++ lib/str-two-way.h | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 66d6ed03af..a805d0b2ad 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2022-05-21 Paul Eggert + + strstr-simple: pacify GCC 12.1 + * lib/str-two-way.h (two_way_long_needle): Pacify GCC 12.1 + -Wsuggest-attribute=pure (x86-64, -O2). + 2022-05-15 Bruno Haible string, wchar: Fix compilation error on MSVC (regression 2021-09-07). diff --git a/lib/str-two-way.h b/lib/str-two-way.h index 7ee344aea1..b00017c0b4 100644 --- a/lib/str-two-way.h +++ b/lib/str-two-way.h @@ -231,7 +231,7 @@ critical_factorization (const unsigned char *needle, size_t needle_len, most 2 * HAYSTACK_LEN - NEEDLE_LEN comparisons occur in searching. If AVAILABLE modifies HAYSTACK_LEN (as in strstr), then at most 3 * HAYSTACK_LEN - NEEDLE_LEN comparisons occur in searching. */ -static RETURN_TYPE +static RETURN_TYPE _GL_ATTRIBUTE_PURE two_way_short_needle (const unsigned char *haystack, size_t haystack_len, const unsigned char *needle, size_t needle_len) { @@ -325,7 +325,7 @@ two_way_short_needle (const unsigned char *haystack, size_t haystack_len, If AVAILABLE modifies HAYSTACK_LEN (as in strstr), then at most 3 * HAYSTACK_LEN - NEEDLE_LEN comparisons occur in searching, and sublinear performance is not possible. */ -static RETURN_TYPE +static RETURN_TYPE _GL_ATTRIBUTE_PURE two_way_long_needle (const unsigned char *haystack, size_t haystack_len, const unsigned char *needle, size_t needle_len) { -- 2.39.5