[CRIU] [PATCH] Makefile: add -Wformat-security to CFLAGS

Kir Kolyshkin kir at openvz.org
Wed Aug 31 13:09:18 PDT 2016


Apparently when travis checks patches, it compiles code with
-Wformat-security (most probably because the distro/gcc it uses
has it on by default), but on my system (Fedora 24/gcc 6.1.1)
this flag is not on. As a result, code compiles fine for me
but travis reports an error.

Add -Wformat-security to default CFLAGS. It helps to catch
problems like using printf(str) instead of printf("%s", str).

Signed-off-by: Kir Kolyshkin <kir at openvz.org>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index f850507..05946a1 100644
--- a/Makefile
+++ b/Makefile
@@ -105,7 +105,7 @@ DEFINES			+= -D_GNU_SOURCE
 
 CFLAGS			+= $(USERCFLAGS)
 
-WARNINGS		:= -Wall
+WARNINGS		:= -Wall -Wformat-security
 
 CFLAGS-GCOV		:= --coverage -fno-exceptions -fno-inline
 export CFLAGS-GCOV
-- 
2.7.4



More information about the CRIU mailing list