summaryrefslogtreecommitdiffstats
path: root/lib/log.h
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@diac24.net>2019-06-12 17:08:01 +0200
committerDavid Lamparter <equinox@diac24.net>2019-06-12 19:35:43 +0200
commitafb35622ef61212f0fe960a31c2326a9379bceae (patch)
treea3e691f3bd7e9d59871462d1bab8bdef63d3dd24 /lib/log.h
parentlib: use snprintfrr() in "hidden" printfs (diff)
downloadfrr-afb35622ef61212f0fe960a31c2326a9379bceae.tar.xz
frr-afb35622ef61212f0fe960a31c2326a9379bceae.zip
lib: make "%Ld" work for int64_t
... without compiler plugins. Signed-off-by: David Lamparter <equinox@diac24.net>
Diffstat (limited to 'lib/log.h')
-rw-r--r--lib/log.h19
1 files changed, 6 insertions, 13 deletions
diff --git a/lib/log.h b/lib/log.h
index 3ef4d2f37..c5ae6fe32 100644
--- a/lib/log.h
+++ b/lib/log.h
@@ -81,20 +81,13 @@ extern void openzlog(const char *progname, const char *protoname,
/* Close zlog function. */
extern void closezlog(void);
-/* GCC have printf type attribute check. */
-#ifdef __GNUC__
-#define PRINTF_ATTRIBUTE(a,b) __attribute__ ((__format__ (__printf__, a, b)))
-#else
-#define PRINTF_ATTRIBUTE(a,b)
-#endif /* __GNUC__ */
-
/* Handy zlog functions. */
-extern void zlog_err(const char *format, ...) PRINTF_ATTRIBUTE(1, 2);
-extern void zlog_warn(const char *format, ...) PRINTF_ATTRIBUTE(1, 2);
-extern void zlog_info(const char *format, ...) PRINTF_ATTRIBUTE(1, 2);
-extern void zlog_notice(const char *format, ...) PRINTF_ATTRIBUTE(1, 2);
-extern void zlog_debug(const char *format, ...) PRINTF_ATTRIBUTE(1, 2);
-extern void zlog(int priority, const char *format, ...) PRINTF_ATTRIBUTE(2, 3);
+extern void zlog_err(const char *format, ...) PRINTFRR(1, 2);
+extern void zlog_warn(const char *format, ...) PRINTFRR(1, 2);
+extern void zlog_info(const char *format, ...) PRINTFRR(1, 2);
+extern void zlog_notice(const char *format, ...) PRINTFRR(1, 2);
+extern void zlog_debug(const char *format, ...) PRINTFRR(1, 2);
+extern void zlog(int priority, const char *format, ...) PRINTFRR(2, 3);
/* For logs which have error codes associated with them */
#define flog_err(ferr_id, format, ...) \