From 85f2fd8d2772506911e95c3e4a0cb2538594b274 Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Sun, 3 Jan 2016 15:20:09 +0200 Subject: Minor changes * configure.ac: Version 1.2.92 * src/ctl.c (ctlio_finalize_reply): Don't close connection on errors. * src/pies.h (PIES_PRINTFLIKE): New macro. (logmsg, logmsg_printf): Mark as printflike. --- src/pies.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/pies.h') diff --git a/src/pies.h b/src/pies.h index 4bc57bd..34f1250 100644 --- a/src/pies.h +++ b/src/pies.h @@ -419,20 +419,28 @@ extern int diag_output; void diag_setup (int flags); -void logmsg (int prio, const char *fmt, ...); -void logmsg_printf (int prio, const char *fmt, ...); +#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) +# define __attribute__(x) +#endif + +#ifndef PIES_PRINTFLIKE +# define PIES_PRINTFLIKE(fmt,narg) __attribute__ ((__format__ (__printf__, fmt, narg))) +#endif + +void logmsg (int prio, const char *fmt, ...) PIES_PRINTFLIKE(2,3); +void logmsg_printf (int prio, const char *fmt, ...) PIES_PRINTFLIKE(2,3); void logmsg_vprintf (int prio, const char *fmt, va_list ap); extern unsigned debug_level; extern int source_info_option; -void debug_msg (const char *fmt, ...); +void debug_msg (const char *fmt, ...) PIES_PRINTFLIKE(1,2); #define debug(lev, args) \ do \ if (debug_level >= lev) \ { \ if (source_info_option) \ - logmsg_printf (LOG_DEBUG, "%s:%lu:%s: ", \ + logmsg_printf (LOG_DEBUG, "%s:%d:%s: ", \ __FILE__, __LINE__, __FUNCTION__); \ debug_msg args; \ } \ -- cgit v1.2.1