[PATCH v2 11/28] argp: Move attribute_hidden to argp-fmtstream.h

Collin Funk collin.funk1@gmail.com
Wed Oct 29 02:04:01 GMT 2025


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

> The internal header redefines the some internal argp functions with
> attribute_hidden, which triggers clang warning of mismatched attributes.
> ---
>  argp/Makefile            |  7 +++----
>  argp/argp-fmtstream.h    | 18 ++++++++++++------
>  include/argp-fmtstream.h | 18 ------------------
>  3 files changed, 15 insertions(+), 28 deletions(-)
>
> diff --git a/argp/Makefile b/argp/Makefile
> index 01eb6b6db8..65d917ad14 100644
> --- a/argp/Makefile
> +++ b/argp/Makefile
> @@ -47,10 +47,9 @@ tests = \
>    tst-ldbl-argp \
>    # tests
>  
> -CFLAGS-argp-help.c += $(uses-callbacks) -fexceptions $(config-cflags-wno-ignored-attributes)
> -CFLAGS-argp-parse.c += $(uses-callbacks) $(config-cflags-wno-ignored-attributes)
> -CFLAGS-argp-fmtstream.c += -fexceptions $(config-cflags-wno-ignored-attributes)
> -CFLAGS-argp-fs-xinl.c += $(config-cflags-wno-ignored-attributes)
> +CFLAGS-argp-help.c += $(uses-callbacks) -fexceptions
> +CFLAGS-argp-parse.c += $(uses-callbacks)
> +CFLAGS-argp-fmtstream.c += -fexceptions
>  
>  bug-argp1-ARGS = -- --help
>  bug-argp2-ARGS = -- -d 111 --dstaddr 222 -p 333 --peer 444
> diff --git a/argp/argp-fmtstream.h b/argp/argp-fmtstream.h
> index 64d3c0abd5..4e52953f42 100644
> --- a/argp/argp-fmtstream.h
> +++ b/argp/argp-fmtstream.h
> @@ -107,19 +107,22 @@ __BEGIN_DECLS
>  extern argp_fmtstream_t __argp_make_fmtstream (FILE *__stream,
>  					       size_t __lmargin,
>  					       size_t __rmargin,
> -					       ssize_t __wmargin);
> +					       ssize_t __wmargin)
> +     attribute_hidden;

Looks good to me. When (or if) someone resyncs with Gnulib we can define
the attribute to expand to nothing there.

Reviewed-by: Collin Funk <collin.funk1@gmail.com>

Collin


More information about the Libc-alpha mailing list