fortify-headers

standalone fortify-source implementation
git clone git://git.2f30.org/fortify-headers
Log | Files | Refs | README | LICENSE

commit e4fe187649888bfa54dd92e4c6b85683579058e8
parent e6837a7874a40d5fe78dd3edd5f6dab68d87a962
Author: sin <sin@2f30.org>
Date:   Fri, 30 Jan 2015 16:25:13 +0000

Remove __restrict

Diffstat:
Minclude/stdio.h | 3+--
Minclude/string.h | 22+++++++++++-----------
Minclude/strings.h | 2+-
3 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/include/stdio.h b/include/stdio.h @@ -29,8 +29,7 @@ __attribute__ ((always_inline)) __attribute__ ((__format__ (printf, 3, 0))) __attribute__ ((__nonnull__ (3))) int -__fortify_vsnprintf(char *__restrict s, size_t n, const char *__restrict fmt, - __builtin_va_list ap) +__fortify_vsnprintf(char *s, size_t n, const char *fmt, __builtin_va_list ap) { size_t bos = __builtin_object_size(s, 0); diff --git a/include/string.h b/include/string.h @@ -11,7 +11,7 @@ __errordecl(__memcpy_error, "memcpy: buffer overflow detected"); static inline __attribute__ ((always_inline)) void * -__fortify_memcpy(void *__restrict dest, const void *__restrict src, size_t n) +__fortify_memcpy(void *dest, const void *src, size_t n) { size_t bos = __builtin_object_size(dest, 0); char *d = dest; @@ -32,7 +32,7 @@ __fortify_memcpy(void *__restrict dest, const void *__restrict src, size_t n) __errordecl(__memmove_error, "memmove: buffer overflow detected"); static inline __attribute__ ((always_inline)) void * -__fortify_memmove(void *__restrict dest, const void *__restrict src, size_t n) +__fortify_memmove(void *dest, const void *src, size_t n) { size_t bos = __builtin_object_size(dest, 0); @@ -61,7 +61,7 @@ __fortify_memset(void *dest, int c, size_t n) static inline __attribute__ ((always_inline)) char * -__fortify_stpcpy(char *__restrict dest, const char *__restrict src) +__fortify_stpcpy(char *dest, const char *src) { size_t bos = __builtin_object_size(dest, 0); @@ -73,7 +73,7 @@ __fortify_stpcpy(char *__restrict dest, const char *__restrict src) __errordecl(__stpncpy_error, "stpncpy: buffer overflow detected"); static inline __attribute__ ((always_inline)) char * -__fortify_stpncpy(char *__restrict dest, const char *__restrict src, size_t n) +__fortify_stpncpy(char *dest, const char *src, size_t n) { size_t bos = __builtin_object_size(dest, 0); @@ -87,7 +87,7 @@ __fortify_stpncpy(char *__restrict dest, const char *__restrict src, size_t n) static inline __attribute__ ((always_inline)) char * -__fortify_strcat(char *__restrict dest, const char *__restrict src) +__fortify_strcat(char *dest, const char *src) { size_t bos = __builtin_object_size(dest, 0); @@ -98,7 +98,7 @@ __fortify_strcat(char *__restrict dest, const char *__restrict src) static inline __attribute__ ((always_inline)) char * -__fortify_strcpy(char *__restrict dest, const char *__restrict src) +__fortify_strcpy(char *dest, const char *src) { size_t bos = __builtin_object_size(dest, 0); @@ -110,7 +110,7 @@ __fortify_strcpy(char *__restrict dest, const char *__restrict src) __errordecl(__strncat_error, "strncat: buffer overflow detected"); static inline __attribute__ ((always_inline)) char * -__fortify_strncat(char *__restrict dest, const char *__restrict src, size_t n) +__fortify_strncat(char *dest, const char *src, size_t n) { size_t bos = __builtin_object_size(dest, 0); size_t slen, dlen; @@ -132,7 +132,7 @@ __fortify_strncat(char *__restrict dest, const char *__restrict src, size_t n) __errordecl(__strncpy_error, "strncpy: buffer overflow detected"); static inline __attribute__ ((always_inline)) char * -__fortify_strncpy(char *__restrict dest, const char *__restrict src, size_t n) +__fortify_strncpy(char *dest, const char *src, size_t n) { size_t bos = __builtin_object_size(dest, 0); @@ -148,7 +148,7 @@ __fortify_strncpy(char *__restrict dest, const char *__restrict src, size_t n) __errordecl(__mempcpy_error, "mempcpy: buffer overflow detected"); static inline __attribute__ ((always_inline)) void * -__fortify_mempcpy(void *__restrict dest, const void *__restrict src, size_t n) +__fortify_mempcpy(void *dest, const void *src, size_t n) { size_t bos = __builtin_object_size(dest, 0); @@ -165,7 +165,7 @@ __fortify_mempcpy(void *__restrict dest, const void *__restrict src, size_t n) __errordecl(__strlcat_error, "strlcat: buffer overflow detected"); static inline __attribute__ ((always_inline)) size_t -__fortify_strlcat(char *__restrict dest, const char *__restrict src, size_t n) +__fortify_strlcat(char *dest, const char *src, size_t n) { size_t bos = __builtin_object_size(dest, 0); @@ -180,7 +180,7 @@ __fortify_strlcat(char *__restrict dest, const char *__restrict src, size_t n) __errordecl(__strlcpy_error, "strlcpy: buffer overflow detected"); static inline __attribute__ ((always_inline)) size_t -__fortify_strlcpy(char *__restrict dest, const char *__restrict src, size_t n) +__fortify_strlcpy(char *dest, const char *src, size_t n) { size_t bos = __builtin_object_size(dest, 0); diff --git a/include/strings.h b/include/strings.h @@ -14,7 +14,7 @@ __errordecl(__bcopy_error, "bcopy: buffer overflow detected"); static inline __attribute__ ((always_inline)) void -__fortify_bcopy(const void *__restrict src, void *__restrict dest, size_t n) +__fortify_bcopy(const void *src, void *dest, size_t n) { size_t bos = __builtin_object_size(dest, 0);