X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fcommon%2Fcommon.c;h=c82bee330c2e2ff963c10a044e5bcdcef63fd813;hb=2ea09241f07f1dfd4b6fd0f2f296a10142fda7d2;hp=048e3d27ce4001ca6a6c443239106b7d6764095c;hpb=0235b0db7de5bcacdb3650c92461f2ce5eb2143d;p=babeltrace.git diff --git a/src/common/common.c b/src/common/common.c index 048e3d27..c82bee33 100644 --- a/src/common/common.c +++ b/src/common/common.c @@ -27,6 +27,7 @@ #include "common/macros.h" #include "common/common.h" #include "compat/unistd.h" +#include "compat/limits.h" #ifndef __MINGW32__ #include @@ -1454,8 +1455,11 @@ size_t bt_common_get_page_size(int log_level) size_t _tmp_fmt_size = (size_t) (fmt_ch - *out_fmt_ch); \ strncpy(_tmp_fmt, *out_fmt_ch, _tmp_fmt_size); \ _tmp_fmt[_tmp_fmt_size] = '\0'; \ + _Pragma("GCC diagnostic push") \ + _Pragma("GCC diagnostic ignored \"-Wformat-nonliteral\"") \ _count = snprintf(*buf_ch, _size, _tmp_fmt, __VA_ARGS__); \ - BT_ASSERT_DBG(_count >= 0); \ + _Pragma("GCC diagnostic pop") \ + BT_ASSERT_DBG(_count >= 0); \ *buf_ch += MIN(_count, _size); \ } while (0)