diff options
Diffstat (limited to 'include/stdlib.h')
| -rw-r--r-- | include/stdlib.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/stdlib.h b/include/stdlib.h index 3f3c3ba..4efdb82 100644 --- a/include/stdlib.h +++ b/include/stdlib.h | |||
| @@ -42,18 +42,21 @@ extern "C" { | |||
| 42 | 42 | ||
| 43 | __malloc(malloc (free, 1)) | 43 | __malloc(malloc (free, 1)) |
| 44 | __alloc_size(1) | 44 | __alloc_size(1) |
| 45 | __diagnose_as_builtin(__builtin_malloc, 1) | ||
| 45 | _FORTIFY_FN(malloc) void *malloc(size_t __s) | 46 | _FORTIFY_FN(malloc) void *malloc(size_t __s) |
| 46 | { | 47 | { |
| 47 | return __orig_malloc(__s); | 48 | return __orig_malloc(__s); |
| 48 | } | 49 | } |
| 49 | 50 | ||
| 50 | __alloc_size(2) | 51 | __alloc_size(2) |
| 52 | __diagnose_as_builtin(__builtin_realloc, 1, 2) | ||
| 51 | _FORTIFY_FN(realloc) void *realloc(void *__p, size_t __s) | 53 | _FORTIFY_FN(realloc) void *realloc(void *__p, size_t __s) |
| 52 | { | 54 | { |
| 53 | return __orig_realloc(__p, __s); | 55 | return __orig_realloc(__p, __s); |
| 54 | } | 56 | } |
| 55 | 57 | ||
| 56 | __alloc_size(1, 2) | 58 | __alloc_size(1, 2) |
| 59 | __diagnose_as_builtin(__builtin_calloc, 1, 2) | ||
| 57 | _FORTIFY_FN(calloc) void *calloc(size_t __n, size_t __s) | 60 | _FORTIFY_FN(calloc) void *calloc(size_t __n, size_t __s) |
| 58 | { | 61 | { |
| 59 | return __orig_calloc(__n, __s); | 62 | return __orig_calloc(__n, __s); |
| @@ -62,6 +65,7 @@ _FORTIFY_FN(calloc) void *calloc(size_t __n, size_t __s) | |||
| 62 | #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) | 65 | #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) |
| 63 | #undef reallocarray | 66 | #undef reallocarray |
| 64 | __alloc_size (2, 3) | 67 | __alloc_size (2, 3) |
| 68 | __diagnose_as_builtin(__builtin_reallocarray, 1, 2, 3) | ||
| 65 | _FORTIFY_FN(reallocarray) void* reallocarray(void* __p, size_t __n, size_t __s) | 69 | _FORTIFY_FN(reallocarray) void* reallocarray(void* __p, size_t __n, size_t __s) |
| 66 | { | 70 | { |
| 67 | return __orig_reallocarray(__p, __n, __s); | 71 | return __orig_reallocarray(__p, __n, __s); |
| @@ -71,6 +75,7 @@ _FORTIFY_FN(reallocarray) void* reallocarray(void* __p, size_t __n, size_t __s) | |||
| 71 | /* FIXME clang */ | 75 | /* FIXME clang */ |
| 72 | #if (defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)) && !defined(__clang__) | 76 | #if (defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)) && !defined(__clang__) |
| 73 | #undef realpath | 77 | #undef realpath |
| 78 | __diagnose_as_builtin(__builtin_realpath, 1, 2) | ||
| 74 | _FORTIFY_FN(realpath) char *realpath(const char *__p, char *__r) | 79 | _FORTIFY_FN(realpath) char *realpath(const char *__p, char *__r) |
| 75 | { | 80 | { |
| 76 | #ifndef PATH_MAX | 81 | #ifndef PATH_MAX |
