[PATCH] Use __artificial__ attribute for GCC 4.3+

Jakub Jelinek jakub@redhat.com
Wed Oct 3 09:12:00 GMT 2007


Hi!

All __extern_always_inline functions in glibc IMHO benefit from using
the artificial attribute.

2007-10-03  Jakub Jelinek  <jakub@redhat.com>

	* misc/sys/cdefs.h (__extern_always_inline): For GCC 4.3+
	add __artificial__ attribute.

--- libc/misc/sys/cdefs.h.jj	2007-09-29 20:51:57.000000000 +0200
+++ libc/misc/sys/cdefs.h	2007-10-01 10:05:29.000000000 +0200
@@ -294,8 +294,13 @@
 #if !defined __cplusplus || __GNUC_PREREQ (4,3)
 # if defined __GNUC_STDC_INLINE__ || defined __cplusplus
 #  define __extern_inline extern __inline __attribute__ ((__gnu_inline__))
-#  define __extern_always_inline \
+#  if __GNUC_PREREQ (4,3)
+#   define __extern_always_inline \
+  extern __always_inline __attribute__ ((__gnu_inline__, __artificial__))
+#  else
+#   define __extern_always_inline \
   extern __always_inline __attribute__ ((__gnu_inline__))
+#  endif
 # else
 #  define __extern_inline extern __inline
 #  define __extern_always_inline extern __always_inline

	Jakub



More information about the Libc-hacker mailing list