mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-07 18:12:55 +03:00
debug.h: Add in parameter format checking to coap_log_impl() for GNUC
For GNUC. make the function
void coap_log_impl(coap_log_t level,
const char *format, ...) __attribute__ ((format(printf, 2, 3)));
This commit is contained in:
1 parent
82c9ccc75b
commit
93c8471233
1 file changed
+5
@@ -57,7 +57,12 @@ const char *coap_package_version(void);
|
||||
* COAP_DEBUG_FD (for @p level >= @c LOG_WARNING). The text is output only when
|
||||
* @p level is below or equal to the log level that set by coap_set_log_level().
|
||||
*/
|
||||
#if (defined(__GNUC__))
|
||||
void coap_log_impl(coap_log_t level,
|
||||
const char *format, ...) __attribute__ ((format(printf, 2, 3)));
|
||||
#else
|
||||
void coap_log_impl(coap_log_t level, const char *format, ...);
|
||||
#endif
|
||||
|
||||
#ifndef coap_log
|
||||
#define coap_log(level, ...) do { if ((level)<=coap_get_log_level()) coap_log_impl((level), __VA_ARGS__); } while(0)
|
||||
|
||||
Reference in new issue
Block a user