diff options
author | Quentin Young <qlyoung@cumulusnetworks.com> | 2017-06-30 18:18:20 +0200 |
---|---|---|
committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2017-06-30 18:18:20 +0200 |
commit | fe232cf8197963decb8b68e4a62de3734a7d5cde (patch) | |
tree | 12374d17ae7a16e9a07588ff5edff7b4e39f92f5 /lib/zebra.h | |
parent | Merge pull request #768 from qlyoung/fix-gitignore2 (diff) | |
download | frr-fe232cf8197963decb8b68e4a62de3734a7d5cde.tar.xz frr-fe232cf8197963decb8b68e4a62de3734a7d5cde.zip |
lib: printf bugfixes & improvement
* Fix bad format specifier in thread.[ch]
* Move PRINTF_ATTRIBUTE macro to zebra.h
* Use PRINTF_ATTRIBUTE on termtable printers
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'lib/zebra.h')
-rw-r--r-- | lib/zebra.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/zebra.h b/lib/zebra.h index 2cc433a86..901a49073 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. |