[PATCH 38/59] Fix -Wno-ignored-attributes configure check

Sam James sam@gentoo.org
Sat Oct 18 06:46:42 GMT 2025


Adhemerval Zanella <adhemerval.zanella@linaro.org> writes:

> The configure check always fail with clang:
>
> conftest.c:5:58: error: expected string literal as argument of 'alias' attribute
>     5 | extern __typeof (__foo) foo __attribute__ ((weak, alias (__foo)));
>       |                                                          ^
> conftest.c:6:58: error: expected string literal as argument of 'alias' attribute
>     6 | extern __typeof (__foo) bar __attribute__ ((weak, alias (foo)));
>       |                                                          ^

Ow.

Reviewed-by: Sam James <sam@gentoo.org>

> ---
>  configure    | 4 ++--
>  configure.ac | 4 ++--
>  2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/configure b/configure
> index fa888eeb9f..789f68da75 100755
> --- a/configure
> +++ b/configure
> @@ -7548,8 +7548,8 @@ conftest_code="
>  void __foo (void)
>  {
>  }
> -extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
> -extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
> +extern __typeof (__foo) foo __attribute__ ((weak, alias (\"__foo\")));
> +extern __typeof (__foo) bar __attribute__ ((weak, alias (\"foo\")));
>  "
>  
>  cat > conftest.c <<EOF
> diff --git a/configure.ac b/configure.ac
> index fe78f7f802..aa4641edae 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -1428,8 +1428,8 @@ conftest_code="
>  void __foo (void)
>  {
>  }
> -extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
> -extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
> +extern __typeof (__foo) foo __attribute__ ((weak, alias (\"__foo\")));
> +extern __typeof (__foo) bar __attribute__ ((weak, alias (\"foo\")));
>  "
>  LIBC_TRY_CC_AND_TEST_CC_COMMAND([if -Wno-ignored-attributes is required for aliases],
>    [$conftest_code],


More information about the Libc-alpha mailing list