summaryrefslogtreecommitdiff
path: root/include/sys/cdefs.h
diff options
context:
space:
mode:
authorYann Sionneau <ysionneau@kalray.eu>2021-08-17 22:09:53 +0200
committerWaldemar Brodkorb <wbx@openadk.org>2021-08-25 14:14:02 +0200
commit74b93e4d32633fc896ec61ca73b79f7d4725e2a3 (patch)
tree250d77fa44602085227f5debc7d3227f00e6ee73 /include/sys/cdefs.h
parent0894e879f091a6a281c02b8da1c0606f4f2dcfb8 (diff)
Fix warnings due to missing attributes for __EI_ prefixed symbols
With new compiler (gcc >= 9 ?) building uClibc-ng now gives this sort of warnings: ./include/libc-symbols.h:426:25: warning: '__EI_localeconv' specifies less restrictive attribute than its target 'localeconv': 'nothrow' [-Wmissing-attributes] 426 | extern __typeof (name) __EI_##name __attribute__((alias (__hidden_asmname1 (,#local)))) | ^~~~~ ./include/libc-symbols.h:429:29: note: in expansion of macro '__hidden_ver1' 429 | # define hidden_def(name) __hidden_ver1(__GI_##name, name, name); | ^~~~~~~~~~~~~ ./include/libc-symbols.h:497:32: note: in expansion of macro 'hidden_def' 497 | # define libc_hidden_def(name) hidden_def (name) | ^~~~~~~~~~ libc/misc/locale/locale.c:306:1: note: in expansion of macro 'libc_hidden_def' 306 | libc_hidden_def(localeconv) | ^~~~~~~~~~~~~~~ In file included from libc/misc/locale/localeconv.c:8: libc/misc/locale/locale.c:261:15: note: '__EI_localeconv' target declared here 261 | struct lconv *localeconv(void) | ^~~~~~~~~~ The fix is mostly being backported/adapted from glibc.
Diffstat (limited to 'include/sys/cdefs.h')
-rw-r--r--include/sys/cdefs.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/sys/cdefs.h b/include/sys/cdefs.h
index a4359a05c..5c4daebcd 100644
--- a/include/sys/cdefs.h
+++ b/include/sys/cdefs.h
@@ -330,6 +330,17 @@
# endif
#endif
+/* Undefine (also defined in libc-symbols.h). */
+#undef __attribute_copy__
+#if __GNUC_PREREQ (9, 0)
+/* Copies attributes from the declaration or type referenced by
+ the argument. */
+# define __attribute_copy__(arg) __attribute__ ((__copy__ (arg)))
+#else
+# define __attribute_copy__(arg)
+#endif
+
+
/* GCC 4.3 and above allow passing all anonymous arguments of an
__extern_always_inline function to some other vararg function. */
#if __GNUC_PREREQ (4,3)