summaryrefslogtreecommitdiff
path: root/include/stdio.h
diff options
context:
space:
mode:
authorHaelwenn (lanodan) Monnier2025-12-29 21:15:44 +0100
committerJulien Voisin2025-12-30 11:25:44 +0100
commit4797899b24d35873211cf0cd1a2a373e2db3c528 (patch)
treeb8e1059b87e7e582674c54c66f5168d2eb54c7db /include/stdio.h
parent611069d07c14bf7ace7a75fa2bc9147db8ac097d (diff)
Change __format into __fortify_format to fix conflict with LLVM libcxx
LLVM libcxx (20.1.8) also defines a `__format` macro in it's C++ locale header (`/usr/include/c++/v1/locale`). Fixes: https://github.com/jvoisin/fortify-headers/issues/76
Diffstat (limited to '')
-rw-r--r--include/stdio.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/stdio.h b/include/stdio.h
index aebe861..333978b 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -76,7 +76,7 @@ _FORTIFY_FN(fwrite) size_t fwrite(const void * _FORTIFY_POS0 __d, size_t __n,
76 return __orig_fwrite(__d, __n, __m, __f); 76 return __orig_fwrite(__d, __n, __m, __f);
77} 77}
78 78
79__format(printf, 3, 0) 79__fortify__format(printf, 3, 0)
80__access(write_only, 1, 2) 80__access(write_only, 1, 2)
81__access(read_only, 3) 81__access(read_only, 3)
82_FORTIFY_FN(vsnprintf) int vsnprintf(char * _FORTIFY_POS0 __s, size_t __n, 82_FORTIFY_FN(vsnprintf) int vsnprintf(char * _FORTIFY_POS0 __s, size_t __n,
@@ -89,7 +89,7 @@ _FORTIFY_FN(vsnprintf) int vsnprintf(char * _FORTIFY_POS0 __s, size_t __n,
89 return __orig_vsnprintf(__s, __n, __f, __v); 89 return __orig_vsnprintf(__s, __n, __f, __v);
90} 90}
91 91
92__format(printf, 2, 0) 92__fortify__format(printf, 2, 0)
93__access(write_only, 1) 93__access(write_only, 1)
94__access(read_only, 2) 94__access(read_only, 2)
95_FORTIFY_FN(vsprintf) int vsprintf(char * _FORTIFY_POS0 __s, const char *__f, 95_FORTIFY_FN(vsprintf) int vsprintf(char * _FORTIFY_POS0 __s, const char *__f,
@@ -123,7 +123,7 @@ _FORTIFY_FN(vsprintf) int vsprintf(char * _FORTIFY_POS0 __s, const char *__f,
123 * 3) not implementing these under clang, which is what we do for now 123 * 3) not implementing these under clang, which is what we do for now
124 */ 124 */
125 125
126__format(printf, 3, 4) 126__fortify__format(printf, 3, 4)
127_FORTIFY_FN(snprintf) int snprintf(char *__s, size_t __n, 127_FORTIFY_FN(snprintf) int snprintf(char *__s, size_t __n,
128 const char *__f, ...) 128 const char *__f, ...)
129{ 129{
@@ -134,7 +134,7 @@ _FORTIFY_FN(snprintf) int snprintf(char *__s, size_t __n,
134 return __orig_snprintf(__s, __n, __f, __builtin_va_arg_pack()); 134 return __orig_snprintf(__s, __n, __f, __builtin_va_arg_pack());
135} 135}
136 136
137__format(printf, 2, 3) 137__fortify__format(printf, 2, 3)
138_FORTIFY_FN(sprintf) int sprintf(char *__s, const char *__f, ...) 138_FORTIFY_FN(sprintf) int sprintf(char *__s, const char *__f, ...)
139{ 139{
140 size_t __b = __bos(__s, 0); 140 size_t __b = __bos(__s, 0);