diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2019-01-02 17:00:40 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2019-01-02 17:01:06 -0500 |
commit | 29a49f5d150911428a35943be8d9fc226865eb1b (patch) | |
tree | 35ca4aa4fd793e6398c7943cee0b1732f29419c0 /util.h | |
parent | 7fc7e98df2ea9c34dd1e0cb188554bed933a16df (diff) | |
download | bfs-29a49f5d150911428a35943be8d9fc226865eb1b.tar.xz |
color: Check format strings + args for cfprintf()
%{cc} is now ${cc} to avoid warnings about an unrecognized format
specifier, and %P and %L are now %pP and %pL to make them look more like
standard format strings.
Diffstat (limited to 'util.h')
-rw-r--r-- | util.h | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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); |