aboutsummaryrefslogtreecommitdiff
path: root/src/includes
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2018-02-10 16:48:22 -0600
committerWilliam Hubbs <w.d.hubbs@gmail.com>2018-02-10 16:48:22 -0600
commit0110487722646ebf9bc2c4e12b4b4a3c358cb10d (patch)
tree183b3d75c879386861cc1b5475eabd86c9a2189e /src/includes
parent68b9b0bc2a11d144870d14fcb8ac24e6c9c63354 (diff)
helpers.h: silence compiler warnings about xasprintf
Diffstat (limited to 'src/includes')
-rw-r--r--src/includes/helpers.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/includes/helpers.h b/src/includes/helpers.h
index 6e0ad19f..037a7859 100644
--- a/src/includes/helpers.h
+++ b/src/includes/helpers.h
@@ -28,9 +28,11 @@
#if __GNUC__ > 2 || defined(__INTEL_COMPILER)
# define _dead __attribute__((__noreturn__))
# define _unused __attribute__((__unused__))
+# define _xasprintf(a, b) __attribute__((__format__(__printf__, a, b)))
#else
# define _dead
# define _unused
+# define _xasprintf(a, b)
#endif
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
@@ -132,7 +134,7 @@ _unused static bool existss(const char *pathname)
* functions to handle memory allocation.
* this function was originally written by Mike Frysinger.
*/
-_unused static int xasprintf(char **strp, const char *fmt, ...)
+_unused _xasprintf(2,3) static int xasprintf(char **strp, const char *fmt, ...)
{
va_list ap;
int len;