configure: remove -Wno-format-nonliteral
This patch removes all the offending instances of -Wformat-nonliteral
and removes -Wno-format-nonliteral from the warning flags we enable.
In cases where we re-use the same format string multiple times, like:
const char *const msg = "Hello %d\n";
if (something) {
pass(msg, value);
} else {
fail(msg, value);
}
... my compiler (gcc (Arch Linux 9.2.1+
20200130-2) 9.2.1
20200130)
complains that the format string is not a literal, even though the `msg`
variable is const and assigned a literal. I've replaced these with a
macro.
In other places, we manually manipulate and craft format strings, to
I've just disabled the warning there.
The generated SWIG wrapper for the error appending functions cause some
warnings like this:
bt2/native_bt.c: In function ‘_wrap_current_thread_error_append_cause_from_component__varargs__’:
bt2/native_bt.c:7839:3: error: format not a string literal, argument types not checked [-Werror=format-nonliteral]
7839 | result = (bt_current_thread_error_append_cause_status)bt_current_thread_error_append_cause_from_component(arg1,(char const *)arg2,arg3,(char const *)arg4,ar
g5);
| ^~~~~~
Since we don't actually need these functions from the Python bindings,
I've made SWIG not generate a wrapper for them.
Change-Id: Ic6834dc44abce7be8e113e9cbf3f33a3f09809e2
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/3233
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Tested-by: jenkins <jenkins@lttng.org>