summaryrefslogtreecommitdiff
path: root/lib/zebra.h
diff options
context:
space:
mode:
authorJafar Al-Gharaibeh <Jafaral@users.noreply.github.com>2017-06-30 13:07:23 -0500
committerGitHub <noreply@github.com>2017-06-30 13:07:23 -0500
commit8186327f3d2a5028b55eab9a04c31b5ccd68afd1 (patch)
treee743501662fccc01c44b0f2f9cbc20dd1794f36e /lib/zebra.h
parent5fca4e3635c2778e8349bce0eaf944c26913d321 (diff)
parentfe232cf8197963decb8b68e4a62de3734a7d5cde (diff)
Merge pull request #771 from qlyoung/printf-madness
lib: printf bugfixes & improvement
Diffstat (limited to 'lib/zebra.h')
-rw-r--r--lib/zebra.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/zebra.h b/lib/zebra.h
index 2cc433a863..901a49073d 100644
--- a/lib/zebra.h
+++ b/lib/zebra.h
@@ -247,6 +247,12 @@ size_t strlcpy (char *__restrict dest, const char *__restrict src, size_t size);
#endif /* HAVE_BROKEN_CMSG_FIRSTHDR */
+/* 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__ */
/*
* RFC 3542 defines several macros for using struct cmsghdr.