diff options
author | Tomasz Kramkowski <tk@the-tk.com> | 2020-09-09 20:44:05 +0100 |
---|---|---|
committer | Tomasz Kramkowski <tk@the-tk.com> | 2020-09-09 20:44:05 +0100 |
commit | dbb9d18decbe607767b4d5e201c0ff18cba6b818 (patch) | |
tree | 7f58bce7e76f0c8a3e7c40f900bfb1682fa5e6a0 | |
parent | 02fd4f3b776a3b26d4f1242df83a892576c09bee (diff) | |
download | pack-dbb9d18decbe607767b4d5e201c0ff18cba6b818.tar.gz pack-dbb9d18decbe607767b4d5e201c0ff18cba6b818.tar.xz pack-dbb9d18decbe607767b4d5e201c0ff18cba6b818.zip |
attribute format on some appropriate functions
-rw-r--r-- | trace.c | 1 | ||||
-rw-r--r-- | trace.h | 8 |
2 files changed, 9 insertions, 0 deletions
@@ -10,6 +10,7 @@ enum pack_trace pack_trace = PACK_TRACE_OFF; +ATTRIBUTE_FORMAT(printf, 2, 0) static void trace(enum pack_trace level, const char *fmt, va_list va) { char *type; @@ -5,7 +5,15 @@ #ifndef PACK_TRACE_H #define PACK_TRACE_H +#ifdef DEVEL +#define ATTRIBUTE_FORMAT(type, fmt, args) __attribute__((format(type, fmt, args))) +#else +#define ATTRIBUTE_FORMAT(type, fmt, args) +#endif + +ATTRIBUTE_FORMAT(printf, 1, 2) void tr_call(const char *fmt, ...); +ATTRIBUTE_FORMAT(printf, 1, 2) void tr_debug(const char *fmt, ...); #endif // !PACK_TRACE_H |