summaryrefslogtreecommitdiff
path: root/include/string.h
diff options
context:
space:
mode:
authorjvoisin2025-12-30 11:32:19 +0100
committerJulien Voisin2025-12-30 11:34:48 +0100
commitc4c5fd41124f38a5afee02b8f604ddc21d3b199a (patch)
tree77e2be706743d954bfcaa28163751fcd2f4cd27e /include/string.h
parent4797899b24d35873211cf0cd1a2a373e2db3c528 (diff)
Change __access into __fortify_access to fix potential conflicts
Diffstat (limited to '')
-rw-r--r--include/string.h46
1 files changed, 23 insertions, 23 deletions
diff --git a/include/string.h b/include/string.h
index 987b50c..8f0167f 100644
--- a/include/string.h
+++ b/include/string.h
@@ -37,8 +37,8 @@ extern "C" {
37#undef strncat 37#undef strncat
38#undef strncpy 38#undef strncpy
39 39
40__access(write_only, 1, 3) 40__fortify_access(write_only, 1, 3)
41__access(read_only, 2, 3) 41__fortify_access(read_only, 2, 3)
42_FORTIFY_FN(memcpy) void *memcpy(void * _FORTIFY_POS0 __od, 42_FORTIFY_FN(memcpy) void *memcpy(void * _FORTIFY_POS0 __od,
43 const void * _FORTIFY_POS0 __os, size_t __n) 43 const void * _FORTIFY_POS0 __os, size_t __n)
44{ 44{
@@ -57,8 +57,8 @@ _FORTIFY_FN(memcpy) void *memcpy(void * _FORTIFY_POS0 __od,
57 return __builtin_memcpy(__od, __os, __n); 57 return __builtin_memcpy(__od, __os, __n);
58} 58}
59 59
60__access(write_only, 1, 3) 60__fortify_access(write_only, 1, 3)
61__access(read_only, 2, 3) 61__fortify_access(read_only, 2, 3)
62_FORTIFY_FN(memmove) void *memmove(void * _FORTIFY_POS0 __d, 62_FORTIFY_FN(memmove) void *memmove(void * _FORTIFY_POS0 __d,
63 const void * _FORTIFY_POS0 __s, size_t __n) 63 const void * _FORTIFY_POS0 __s, size_t __n)
64{ 64{
@@ -70,7 +70,7 @@ _FORTIFY_FN(memmove) void *memmove(void * _FORTIFY_POS0 __d,
70 return __orig_memmove(__d, __s, __n); 70 return __orig_memmove(__d, __s, __n);
71} 71}
72 72
73__access(write_only, 1, 3) 73__fortify_access(write_only, 1, 3)
74__warning_if(__c != 0 && __n == 0, "'memset' will set `0` bytes; did you invert the arguments?") 74__warning_if(__c != 0 && __n == 0, "'memset' will set `0` bytes; did you invert the arguments?")
75_FORTIFY_FN(memset) void *memset(void * _FORTIFY_POS0 __d, int __c, size_t __n) 75_FORTIFY_FN(memset) void *memset(void * _FORTIFY_POS0 __d, int __c, size_t __n)
76{ 76{
@@ -85,8 +85,8 @@ _FORTIFY_FN(memset) void *memset(void * _FORTIFY_POS0 __d, int __c, size_t __n)
85 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \ 85 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
86 || defined(_BSD_SOURCE) 86 || defined(_BSD_SOURCE)
87#undef stpcpy 87#undef stpcpy
88__access(write_only, 1) 88__fortify_access(write_only, 1)
89__access(read_only, 2) 89__fortify_access(read_only, 2)
90_FORTIFY_FN(stpcpy) char *stpcpy(char * _FORTIFY_POS0 __d, const char *__s) 90_FORTIFY_FN(stpcpy) char *stpcpy(char * _FORTIFY_POS0 __d, const char *__s)
91{ 91{
92 size_t __b = __bos(__d, 0); 92 size_t __b = __bos(__d, 0);
@@ -97,8 +97,8 @@ _FORTIFY_FN(stpcpy) char *stpcpy(char * _FORTIFY_POS0 __d, const char *__s)
97} 97}
98 98
99#undef stpncpy 99#undef stpncpy
100__access(write_only, 1) 100__fortify_access(write_only, 1)
101__access(read_only, 2) 101__fortify_access(read_only, 2)
102_FORTIFY_FN(stpncpy) char *stpncpy(char * _FORTIFY_POS0 __d, const char *__s, 102_FORTIFY_FN(stpncpy) char *stpncpy(char * _FORTIFY_POS0 __d, const char *__s,
103 size_t __n) 103 size_t __n)
104{ 104{
@@ -110,8 +110,8 @@ _FORTIFY_FN(stpncpy) char *stpncpy(char * _FORTIFY_POS0 __d, const char *__s,
110} 110}
111#endif 111#endif
112 112
113__access(read_write, 1) 113__fortify_access(read_write, 1)
114__access(read_only, 2) 114__fortify_access(read_only, 2)
115_FORTIFY_FN(strcat) char *strcat(char * _FORTIFY_POS0 __d, const char *__s) 115_FORTIFY_FN(strcat) char *strcat(char * _FORTIFY_POS0 __d, const char *__s)
116{ 116{
117 size_t __b = __bos(__d, 0); 117 size_t __b = __bos(__d, 0);
@@ -121,8 +121,8 @@ _FORTIFY_FN(strcat) char *strcat(char * _FORTIFY_POS0 __d, const char *__s)
121 return __orig_strcat(__d, __s); 121 return __orig_strcat(__d, __s);
122} 122}
123 123
124__access(write_only, 1) 124__fortify_access(write_only, 1)
125__access(read_only, 2) 125__fortify_access(read_only, 2)
126_FORTIFY_FN(strcpy) char *strcpy(char * _FORTIFY_POS0 __d, const char *__s) 126_FORTIFY_FN(strcpy) char *strcpy(char * _FORTIFY_POS0 __d, const char *__s)
127{ 127{
128 size_t __b = __bos(__d, 0); 128 size_t __b = __bos(__d, 0);
@@ -132,8 +132,8 @@ _FORTIFY_FN(strcpy) char *strcpy(char * _FORTIFY_POS0 __d, const char *__s)
132 return __orig_strcpy(__d, __s); 132 return __orig_strcpy(__d, __s);
133} 133}
134 134
135__access(read_write, 1) 135__fortify_access(read_write, 1)
136__access(read_only, 2) 136__fortify_access(read_only, 2)
137_FORTIFY_FN(strncat) char *strncat(char * _FORTIFY_POS0 __d, const char *__s, 137_FORTIFY_FN(strncat) char *strncat(char * _FORTIFY_POS0 __d, const char *__s,
138 size_t __n) 138 size_t __n)
139{ 139{
@@ -151,8 +151,8 @@ _FORTIFY_FN(strncat) char *strncat(char * _FORTIFY_POS0 __d, const char *__s,
151 return __orig_strncat(__d, __s, __n); 151 return __orig_strncat(__d, __s, __n);
152} 152}
153 153
154__access(write_only, 1) 154__fortify_access(write_only, 1)
155__access(read_only, 2) 155__fortify_access(read_only, 2)
156_FORTIFY_FN(strncpy) char *strncpy(char * _FORTIFY_POS0 __d, 156_FORTIFY_FN(strncpy) char *strncpy(char * _FORTIFY_POS0 __d,
157 const char *__s, size_t __n) 157 const char *__s, size_t __n)
158{ 158{
@@ -165,8 +165,8 @@ _FORTIFY_FN(strncpy) char *strncpy(char * _FORTIFY_POS0 __d,
165 165
166#ifdef _GNU_SOURCE 166#ifdef _GNU_SOURCE
167#undef mempcpy 167#undef mempcpy
168__access(write_only, 1, 3) 168__fortify_access(write_only, 1, 3)
169__access(read_only, 2, 3) 169__fortify_access(read_only, 2, 3)
170_FORTIFY_FN(mempcpy) void *mempcpy(void * _FORTIFY_POS0 __d, 170_FORTIFY_FN(mempcpy) void *mempcpy(void * _FORTIFY_POS0 __d,
171 const void * _FORTIFY_POS0 __s, size_t __n) 171 const void * _FORTIFY_POS0 __s, size_t __n)
172{ 172{
@@ -182,8 +182,8 @@ _FORTIFY_FN(mempcpy) void *mempcpy(void * _FORTIFY_POS0 __d,
182#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) 182#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
183#undef strlcat 183#undef strlcat
184#undef strlcpy 184#undef strlcpy
185__access(read_write, 1) 185__fortify_access(read_write, 1)
186__access(read_only, 2) 186__fortify_access(read_only, 2)
187_FORTIFY_FN(strlcat) size_t strlcat(char * _FORTIFY_POS0 __d, 187_FORTIFY_FN(strlcat) size_t strlcat(char * _FORTIFY_POS0 __d,
188 const char *__s, size_t __n) 188 const char *__s, size_t __n)
189{ 189{
@@ -194,8 +194,8 @@ _FORTIFY_FN(strlcat) size_t strlcat(char * _FORTIFY_POS0 __d,
194 return __orig_strlcat(__d, __s, __n); 194 return __orig_strlcat(__d, __s, __n);
195} 195}
196 196
197__access(write_only, 1) 197__fortify_access(write_only, 1)
198__access(read_only, 2) 198__fortify_access(read_only, 2)
199_FORTIFY_FN(strlcpy) size_t strlcpy(char * _FORTIFY_POS0 __d, 199_FORTIFY_FN(strlcpy) size_t strlcpy(char * _FORTIFY_POS0 __d,
200 const char *__s, size_t __n) 200 const char *__s, size_t __n)
201{ 201{