X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Flogging%2Flog.c;h=6f8de7b4959bfebfb8eb1a363cb1cc35fa0d9110;hb=0235b0db7de5bcacdb3650c92461f2ce5eb2143d;hp=093930d222ff0dff47b22a6c748af5c8e30653c7;hpb=770538dd64bcd8f258cb059c438f845533900a27;p=babeltrace.git diff --git a/src/logging/log.c b/src/logging/log.c index 093930d2..6f8de7b4 100644 --- a/src/logging/log.c +++ b/src/logging/log.c @@ -1,7 +1,10 @@ /* + * SPDX-License-Identifier: MIT + * + * Copyright (c) 2016 wonder-mice + * * This is zf_log.c, modified with Babeltrace prefixes. * See . - * See LICENSE. */ #include "common/macros.h" @@ -1148,9 +1151,21 @@ static void put_ctx(bt_log_message *const msg) static void put_tag(bt_log_message *const msg, const char *const tag) { _PP_MAP(_BT_LOG_MESSAGE_FORMAT_INIT, BT_LOG_MESSAGE_TAG_FORMAT) + +/* + * This generates a -Wundef warning. The issue was reported upstream: + * + * https://github.com/wonder-mice/zf_log/issues/40 + * + * but there's not much we can do here, so just silence it. + */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wundef" #if !_BT_LOG_MESSAGE_FORMAT_CONTAINS(TAG, BT_LOG_MESSAGE_TAG_FORMAT) VAR_UNUSED(tag); #endif +#pragma GCC diagnostic pop + #if !_BT_LOG_MESSAGE_FORMAT_FIELDS(BT_LOG_MESSAGE_TAG_FORMAT) VAR_UNUSED(msg); #else @@ -1181,7 +1196,8 @@ static void put_src(bt_log_message *const msg, const src_location *const src) #endif } -static void put_msg(bt_log_message *const msg, +static _BT_LOG_PRINTFLIKE(2, 0) +void put_msg(bt_log_message *const msg, const char *const fmt, va_list va) { int n; @@ -1256,7 +1272,8 @@ void bt_log_set_output_v(const unsigned mask, void *const arg, _bt_log_global_output.callback = callback; } -static void _bt_log_write_imp( +static _BT_LOG_PRINTFLIKE(6, 0) +void _bt_log_write_imp( const bt_log_spec *log, const src_location *const src, const mem_block *const mem, const int lvl, const char *const tag, const char *const fmt, va_list va)