From: Simon Marchi Date: Mon, 23 Aug 2021 18:32:51 +0000 (-0400) Subject: configure: enable -Wformat=2 X-Git-Url: http://git.liburcu.org/?a=commitdiff_plain;h=411b31544f22b773b4aad6cdb81faa81dc05e641;hp=411b31544f22b773b4aad6cdb81faa81dc05e641;p=lttng-tools.git configure: enable -Wformat=2 The -Wformat=2 diagnostic flag on GCC enables the -Wformat-nonliteral -Wformat-security diagnostics, which are useful to catch some format string mistakes. -Wformat-security is also enabled by default with Clang, meaning that there were some warnings only appearing with Clang. Try to enabled the -Wformat=2 flag to make things more consistent across compilers and catch more mistakes. The only issues are these, in tests/regression/ust/linking: CC demo_builtin-demo.o In file included from /usr/include/stdio.h:866, from /home/simark/src/lttng-tools/tests/regression/ust/linking/demo.c:9: /usr/include/bits/stdio2.h: In function ‘sprintf’: /usr/include/bits/stdio2.h:40:35: warning: format not a string literal, argument types not checked [-Wformat-nonliteral] 40 | __va_arg_pack ()); | ^~~~~~~~~~~~~ The reason this appears is that this directory uses -Wsystem-headers, making the compiler show diagnostics in headers considered "system headers". Manually silence those warnings by disabling -Wformat-nonliteral in that specific directory. Change-Id: I4c7991e76b2f5405f3b3397348adb9134de37d41 Signed-off-by: Simon Marchi Signed-off-by: Jérémie Galarneau ---