diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2024-04-24 13:17:18 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2024-04-24 16:15:05 -0400 |
commit | 32e50c2faa3e48acb2eae29c23feb5511df2f9ab (patch) | |
tree | 9cea7e21e430b1c591c9c4278a5abe87db067e4e /src/prelude.h | |
parent | 3a72b93d26ad2bb06ea0b7d39257130084b1ee1e (diff) | |
download | bfs-32e50c2faa3e48acb2eae29c23feb5511df2f9ab.tar.xz |
printf: Check dynamic format strings more carefully
Diffstat (limited to 'src/prelude.h')
-rw-r--r-- | src/prelude.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/prelude.h b/src/prelude.h index 7a646a7..ddeacbd 100644 --- a/src/prelude.h +++ b/src/prelude.h @@ -244,6 +244,15 @@ typedef union { #endif /** + * Annotates functions that potentially modify and return format strings. + */ +#if __has_attribute(format_arg) +# define attr_format_arg(arg) __attribute__((format_arg(arg))) +#else +# define attr_format_arg(args) +#endif + +/** * Annotates allocator-like functions. */ #if __has_attribute(malloc) |