aboutsummaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
authorNick Kralevich <nnk@google.com>2014-10-06 14:49:00 -0700
committerElliott Hughes <enh@google.com>2014-10-07 16:37:04 -0700
commitce92b41a00fb86656055eceab9648a858721c3b1 (patch)
treede7dfd41774aa2bb2c23f98e84e309f4eaff9f73 /libc
parentb5e7eba6d1b97e471996fcfe7dbde7cbba7512ef (diff)
downloadbionic-ce92b41a00fb86656055eceab9648a858721c3b1.tar.gz
cdefs.h: add artificial attribute to FORTIFY_SOURCE functions
Otherwise the gcc compiler warning doesn't show up. Add -Wno-error to fortify related tests. Fortify related tests are expected to be examples of bad programs, and in many cases shouldn't compile cleanly. Rewriting them to compile cleanly isn't feasible nor desirable. Bug: 17784968 (cherry picked from commit 1aaa17802c92d99ae170245c2b2f15a6c27b133e) Change-Id: Ib6df1a3f44b55b1fff222e78395c10c51cd39817
Diffstat (limited to 'libc')
-rw-r--r--libc/include/sys/cdefs.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/libc/include/sys/cdefs.h b/libc/include/sys/cdefs.h
index c764e9bf5..504e4396c 100644
--- a/libc/include/sys/cdefs.h
+++ b/libc/include/sys/cdefs.h
@@ -53,6 +53,9 @@
#ifndef __has_builtin
#define __has_builtin(x) 0
#endif
+#ifndef __has_attribute
+#define __has_attribute(x) 0
+#endif
/*
@@ -511,8 +514,12 @@
#endif
#define __bos0(s) __builtin_object_size((s), 0)
+#if __GNUC_PREREQ(4,3) || __has_attribute(__artificial__)
+#define __BIONIC_FORTIFY_INLINE extern __inline__ __always_inline __attribute__((gnu_inline)) __attribute__((__artificial__))
+#else
#define __BIONIC_FORTIFY_INLINE extern __inline__ __always_inline __attribute__((gnu_inline))
#endif
+#endif
#define __BIONIC_FORTIFY_UNKNOWN_SIZE ((size_t) -1)
/* Used to tag non-static symbols that are private and never exposed by the shared library. */