From 9e3256aead6ed18ac1da1a34f29b22780b007aee Mon Sep 17 00:00:00 2001 From: Paul Elliott Date: Thu, 17 Dec 2020 18:17:32 +0000 Subject: [PATCH] Adding printf format warning flags to makefiles Add printf format warning flags that are supported by GCC 3.0 or later to the makefiles Signed-off-by: Paul Elliott --- library/Makefile | 2 +- programs/Makefile | 4 ++-- tests/Makefile | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/library/Makefile b/library/Makefile index 903dc0df0..6bb9c1781 100644 --- a/library/Makefile +++ b/library/Makefile @@ -2,7 +2,7 @@ # Also see "include/mbedtls/config.h" CFLAGS ?= -O2 -WARNING_CFLAGS ?= -Wall -Wextra +WARNING_CFLAGS ?= -Wall -Wextra -Wformat=2 -Wno-format-nonliteral LDFLAGS ?= # Include ../include for public headers and . for private headers. diff --git a/programs/Makefile b/programs/Makefile index e0a324f1e..90338755b 100644 --- a/programs/Makefile +++ b/programs/Makefile @@ -3,8 +3,8 @@ # To compile with PKCS11: add "-lpkcs11-helper" to LDFLAGS CFLAGS ?= -O2 -WARNING_CFLAGS ?= -Wall -Wextra -WARNING_CXXFLAGS ?= -Wall -Wextra +WARNING_CFLAGS ?= -Wall -Wextra -Wformat=2 -Wno-format-nonliteral +WARNING_CXXFLAGS ?= -Wall -Wextra -Wformat=2 -Wno-format-nonliteral LDFLAGS ?= MBEDTLS_TEST_PATH:=../tests/src diff --git a/tests/Makefile b/tests/Makefile index d11d90441..d250d717a 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -3,7 +3,7 @@ # To compile with PKCS11: add "-lpkcs11-helper" to LDFLAGS CFLAGS ?= -O2 -WARNING_CFLAGS ?= -Wall -Wextra +WARNING_CFLAGS ?= -Wall -Wextra -Wformat=2 -Wno-format-nonliteral LDFLAGS ?= # Include public header files from ../include, test-specific header files