From 543ddd628f731ef2080c07f7abe3476b3fc86d11 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Tue, 28 Oct 2025 14:08:20 -0300 Subject: [PATCH] argp: Move attribute_hidden to argp-fmtstream.h The internal header redefines the some internal argp functions with attribute_hidden, which triggers clang warning of mismatched attributes. Reviewed-by: Collin Funk --- 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 01eb6b6db8f..65d917ad14c 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 64d3c0abd52..4e52953f423 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; extern argp_fmtstream_t argp_make_fmtstream (FILE *__stream, size_t __lmargin, size_t __rmargin, ssize_t __wmargin); /* Flush __FS to its stream, and free it (but don't close the stream). */ -extern void __argp_fmtstream_free (argp_fmtstream_t __fs); +extern void __argp_fmtstream_free (argp_fmtstream_t __fs) + attribute_hidden; extern void argp_fmtstream_free (argp_fmtstream_t __fs); extern ssize_t __argp_fmtstream_printf (argp_fmtstream_t __fs, const char *__fmt, ...) - __attribute__ ((__format__ (printf, 2, 3))); + __attribute__ ((__format__ (printf, 2, 3))) + attribute_hidden; extern ssize_t argp_fmtstream_printf (argp_fmtstream_t __fs, const char *__fmt, ...) __attribute__ ((__format__ (printf, 2, 3))); @@ -131,7 +134,8 @@ extern int __argp_fmtstream_puts (argp_fmtstream_t __fs, const char *__str); extern int argp_fmtstream_puts (argp_fmtstream_t __fs, const char *__str); extern size_t __argp_fmtstream_write (argp_fmtstream_t __fs, - const char *__str, size_t __len); + const char *__str, size_t __len) + attribute_hidden; extern size_t argp_fmtstream_write (argp_fmtstream_t __fs, const char *__str, size_t __len); @@ -167,9 +171,11 @@ extern size_t __argp_fmtstream_point (argp_fmtstream_t __fs); /* Internal routines. */ extern void _argp_fmtstream_update (argp_fmtstream_t __fs); -extern void __argp_fmtstream_update (argp_fmtstream_t __fs); +extern void __argp_fmtstream_update (argp_fmtstream_t __fs) + attribute_hidden; extern int _argp_fmtstream_ensure (argp_fmtstream_t __fs, size_t __amount); -extern int __argp_fmtstream_ensure (argp_fmtstream_t __fs, size_t __amount); +extern int __argp_fmtstream_ensure (argp_fmtstream_t __fs, size_t __amount) + attribute_hidden; #ifdef __OPTIMIZE__ /* Inline versions of above routines. */ diff --git a/include/argp-fmtstream.h b/include/argp-fmtstream.h index 45c65ce834f..69cde22d18a 100644 --- a/include/argp-fmtstream.h +++ b/include/argp-fmtstream.h @@ -1,19 +1 @@ -#ifndef _ARGP_FMTSTREAM_H #include - -#ifndef _ISOMAC -extern __typeof (__argp_fmtstream_ensure) __argp_fmtstream_ensure - attribute_hidden; -extern __typeof (__argp_fmtstream_free) __argp_fmtstream_free - attribute_hidden; -extern __typeof (__argp_fmtstream_printf) __argp_fmtstream_printf - attribute_hidden; -extern __typeof (__argp_fmtstream_update) __argp_fmtstream_update - attribute_hidden; -extern __typeof (__argp_fmtstream_write) __argp_fmtstream_write - attribute_hidden; -extern __typeof (__argp_make_fmtstream) __argp_make_fmtstream - attribute_hidden; -#endif - -#endif -- 2.47.3