summaryrefslogtreecommitdiffstats
path: root/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'util.h')
-rw-r--r--util.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/util.h b/util.h
index 836db37..4a9947c 100644
--- a/util.h
+++ b/util.h
@@ -68,6 +68,15 @@
#endif
/**
+ * Adds compiler warnings for bad printf()-style function calls, if supported.
+ */
+#if __GNUC__
+# define BFS_FORMATTER(fmt, args) __attribute__((format(printf, fmt, args)))
+#else
+# define BFS_FORMATTER(fmt, args)
+#endif
+
+/**
* readdir() wrapper that makes error handling cleaner.
*/
int xreaddir(DIR *dir, struct dirent **de);