]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Use leaf function attribute in __THROW
authorUlrich Drepper <drepper@gmail.com>
Mon, 17 Oct 2011 01:29:11 +0000 (21:29 -0400)
committerUlrich Drepper <drepper@gmail.com>
Mon, 17 Oct 2011 01:29:11 +0000 (21:29 -0400)
ChangeLog
misc/sys/cdefs.h

index c71959c7be3c25882a3708b7b8d7c3b360623d05..dfd6a3b08a0f593ee47466ed2e8aac0d288ed29e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2011-10-16  Ulrich Drepper  <drepper@gmail.com>
 
+       * misc/sys/cdefs.h: Use leaf function attribute in __THROW.
+
        * sysdeps/ieee754/dbl-64/s_ceil.c: Avoid alias renamed.
        * sysdeps/ieee754/dbl-64/s_floor.c: Likewise.
        * sysdeps/ieee754/dbl-64/s_rint.c: Likewise.
index 165a94a64bc2c856798f777318539c2833d6de54..bef8be7f4a15b3244ebf97c4457eca91fc728154 100644 (file)
 
 #ifdef __GNUC__
 
+/* All functions, except those with callbacks, are leaf functions.  */
+# if __GNUC_PREREQ (4, 6) && !defined _LIBC
+#  define __LEAF , __leaf__
+#  define __LEAF_ATTR __attribute__ ((__leaf__))
+# else
+#  define __LEAF
+#  define __LEAF_ATTR
+# endif
+
 /* GCC can always grok prototypes.  For C++ programs we add throw()
    to help it optimize the function calls.  But this works only with
    gcc 2.8.x and egcs.  For gcc 3.2 and up we even mark C functions
    as non-throwing using a function attribute since programs can use
    the -fexceptions options for C code as well.  */
 # if !defined __cplusplus && __GNUC_PREREQ (3, 3)
-#  define __THROW      __attribute__ ((__nothrow__))
-#  define __NTH(fct)   __attribute__ ((__nothrow__)) fct
+#  define __THROW      __attribute__ ((__nothrow__ __LEAF_ATTR))
+#  define __NTH(fct)   __attribute__ ((__nothrow__ __LEAF_ATTR)) fct
 # else
 #  if defined __cplusplus && __GNUC_PREREQ (2,8)
 #   define __THROW     throw ()
-#   define __NTH(fct)  fct throw ()
+#   define __NTH(fct)  __LEAF_ATTR fct throw ()
 #  else
 #   define __THROW
 #   define __NTH(fct)  fct