configure: enable -Wsuggest-attribute=format
The -Wsuggest-attribute=format warning makes the compiler suggest places
where __attribute__((format(...))) would likely be useful. This patch
turns it on and adds such attributes everywhere my compiler (GCC 9)
suggested to add them.
In cases where we re-use the same format string multiple times, like:
const char *const msg = "Hello %d\n";
BT_LOGE(msg, some_value);
BT_CURRENT_THREAD_ERROR_APPEND_CAUSE_FROM_MESSAGE_ITERATOR("modname", msg, some_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.
Change-Id: I40dd2e70649ec2b651e0109097c217ca9557ad69
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/3232
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>