[v3,1/3] string: Allow use of test-string.h for non-ifunc implementations.

Message ID 20230404190040.2507343-2-josimmon@redhat.com
State Superseded
Headers
Series string: Add tests for strdup and strndup (BZ #30266) |

Checks

Context Check Description
dj/TryBot-apply_patch success Patch applied to master at the time it was sent

Commit Message

Joe Simmons-Talbott April 4, 2023, 7 p.m. UTC
  Mark two variables as unused to silence warning when using
test-string.h for non-ifunc implemenations.
---
 string/test-string.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Adhemerval Zanella Netto April 7, 2023, 6:19 p.m. UTC | #1
On 04/04/23 16:00, Joe Simmons-Talbott via Libc-alpha wrote:
> Mark two variables as unused to silence warning when using
> test-string.h for non-ifunc implemenations.

s/implemenations/implementations

LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

> ---
>  string/test-string.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/string/test-string.h b/string/test-string.h
> index 41de973479..8bcb8afd0a 100644
> --- a/string/test-string.h
> +++ b/string/test-string.h
> @@ -130,8 +130,8 @@ cmdline_process_function (int c)
>  /* Increase size of FUNC_LIST if assert is triggered at run-time.  */
>  static struct libc_ifunc_impl func_list[32];
>  static int func_count;
> -static int impl_count = -1;
> -static impl_t *impl_array;
> +static int impl_count __attribute__ ((unused)) = -1;
> +static impl_t *impl_array __attribute__ ((unused));
>  
>  # define FOR_EACH_IMPL(impl, notall) \
>    impl_t *impl;								\
  

Patch

diff --git a/string/test-string.h b/string/test-string.h
index 41de973479..8bcb8afd0a 100644
--- a/string/test-string.h
+++ b/string/test-string.h
@@ -130,8 +130,8 @@  cmdline_process_function (int c)
 /* Increase size of FUNC_LIST if assert is triggered at run-time.  */
 static struct libc_ifunc_impl func_list[32];
 static int func_count;
-static int impl_count = -1;
-static impl_t *impl_array;
+static int impl_count __attribute__ ((unused)) = -1;
+static impl_t *impl_array __attribute__ ((unused));
 
 # define FOR_EACH_IMPL(impl, notall) \
   impl_t *impl;								\