From 611069d07c14bf7ace7a75fa2bc9147db8ac097d Mon Sep 17 00:00:00 2001 From: jvoisin Date: Fri, 14 Nov 2025 16:25:52 +0100 Subject: Add __diagnose_if annotations --- include/string.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/string.h') diff --git a/include/string.h b/include/string.h index cf0be60..987b50c 100644 --- a/include/string.h +++ b/include/string.h @@ -71,6 +71,7 @@ _FORTIFY_FN(memmove) void *memmove(void * _FORTIFY_POS0 __d, } __access(write_only, 1, 3) +__warning_if(__c != 0 && __n == 0, "'memset' will set `0` bytes; did you invert the arguments?") _FORTIFY_FN(memset) void *memset(void * _FORTIFY_POS0 __d, int __c, size_t __n) { size_t __b = __bos(__d, 0); -- cgit v1.3