Check string format in log_message

Move "printflike" definition to arch.h, it's used both by log.h and
os_calls.h.
master
Pavel Roskin 8 years ago
parent be1d034f91
commit b1527b7947

@ -19,6 +19,10 @@
#if !defined(ARCH_H)
#define ARCH_H
#if defined(HAVE_CONFIG_H)
#include "config_ac.h"
#endif
/* you can define L_ENDIAN or B_ENDIAN and NEED_ALIGN or NO_NEED_ALIGN
in the makefile to override */
@ -125,4 +129,12 @@ typedef signed long long tsi64;
#endif
#endif /* DEFINED_Ts */
/* format string verification */
#if defined(HAVE_FUNC_ATTRIBUTE_FORMAT)
#define printflike(arg_format, arg_first_check) \
__attribute__((__format__(__printf__, arg_format, arg_first_check)))
#else
#define printflike(arg_format, arg_first_check)
#endif
#endif

@ -171,7 +171,7 @@ log_end(void);
* @return
*/
enum logReturns DEFAULT_CC
log_message(const enum logLevels lvl, const char *msg, ...);
log_message(const enum logLevels lvl, const char *msg, ...) printflike(2, 3);
/**
*

@ -21,10 +21,6 @@
#if !defined(OS_CALLS_H)
#define OS_CALLS_H
#if defined(HAVE_CONFIG_H)
#include "config_ac.h"
#endif
#ifndef NULL
#define NULL 0
#endif
@ -45,13 +41,6 @@
#define g_tcp_select g_sck_select
#define g_close_wait_obj g_delete_wait_obj
#if defined(HAVE_FUNC_ATTRIBUTE_FORMAT)
#define printflike(arg_format, arg_first_check) \
__attribute__((__format__(__printf__, arg_format, arg_first_check)))
#else
#define printflike(arg_format, arg_first_check)
#endif
int APP_CC g_rm_temp_dir(void);
int APP_CC g_mk_temp_dir(const char* app_name);
void APP_CC g_init(const char* app_name);

Loading…
Cancel
Save