summaryrefslogtreecommitdiffstats
path: root/src/prelude.h
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2024-04-24 13:17:18 -0400
committerTavian Barnes <tavianator@tavianator.com>2024-04-24 16:15:05 -0400
commit32e50c2faa3e48acb2eae29c23feb5511df2f9ab (patch)
tree9cea7e21e430b1c591c9c4278a5abe87db067e4e /src/prelude.h
parent3a72b93d26ad2bb06ea0b7d39257130084b1ee1e (diff)
downloadbfs-32e50c2faa3e48acb2eae29c23feb5511df2f9ab.tar.xz
printf: Check dynamic format strings more carefully
Diffstat (limited to 'src/prelude.h')
-rw-r--r--src/prelude.h9
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)