From 75b95fa25df74fcd0498bf59e3524f20f594755d Mon Sep 17 00:00:00 2001 From: jvoisin Date: Fri, 22 Sep 2023 18:27:54 +0200 Subject: Add more __diagnose_as_builtin annotations --- include/string.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/string.h') diff --git a/include/string.h b/include/string.h index 2735b55..8a440e4 100644 --- a/include/string.h +++ b/include/string.h @@ -257,6 +257,9 @@ _FORTIFY_FN(mempcpy) void *mempcpy(void * _FORTIFY_POS0 __d, #undef strlcpy __access (read_write, 1) __access (read_only, 2, 3) +#if __has_builtin(__builtin_strlcat) +__diagnose_as_builtin(__builtin_strlcat, 1, 2, 3) +#endif _FORTIFY_FN(strlcat) size_t strlcat(char * _FORTIFY_POS0 __d, const char *__s, size_t __n) { @@ -269,6 +272,9 @@ _FORTIFY_FN(strlcat) size_t strlcat(char * _FORTIFY_POS0 __d, __access (write_only, 1) __access (read_only, 2, 3) +#if __has_builtin(__builtin_strlcpy) +__diagnose_as_builtin(__builtin_strlcpy, 1, 2, 3) +#endif _FORTIFY_FN(strlcpy) size_t strlcpy(char * _FORTIFY_POS0 __d, const char *__s, size_t __n) { -- cgit v1.3