]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
argp: Move attribute_hidden to argp-fmtstream.h
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Wed, 22 Oct 2025 12:52:08 +0000 (09:52 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Mon, 27 Oct 2025 19:10:22 +0000 (16:10 -0300)
The internal header redefines the some internal argp functions with
attribute_hidden, which triggers clang warning of mismatched attributes.

argp/Makefile
argp/argp-fmtstream.h
include/argp-fmtstream.h

index 01eb6b6db8fa4ae4c5b217c42e91f84d4e771f70..65d917ad14cc41bab573cd0d89cf177a54f510b7 100644 (file)
@@ -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
index 64d3c0abd520be98dbeb77285b6ca29a7c1637a2..4e52953f4238a940ba6accffaf52b3990692e659 100644 (file)
@@ -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);
 \f
@@ -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;
 \f
 #ifdef __OPTIMIZE__
 /* Inline versions of above routines.  */
index 45c65ce834fd67d96f4f64bbda3c1dfbb0469cf2..69cde22d18a9cf19b5b117410a30b47167f51c20 100644 (file)
@@ -1,19 +1 @@
-#ifndef _ARGP_FMTSTREAM_H
 #include <argp/argp-fmtstream.h>
-
-#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