From 439203cb04cee677a6cd8bf9cb02b82d626713cc Mon Sep 17 00:00:00 2001 From: Jens Wiklander Date: Wed, 26 Sep 2018 15:32:49 +0200 Subject: Allow mixed declaration and code Removes the -Wdeclaration-after-statement compiler flag to allow mixed declaration and code Acked-by: Jerome Forissier Signed-off-by: Jens Wiklander --- README.md | 3 +++ core/lib/libtomcrypt/src/sub.mk | 1 - lib/libmpa/sub.mk | 1 - mk/compile.mk | 3 +-- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0aa7a2fda..7a320f09c 100644 --- a/README.md +++ b/README.md @@ -120,6 +120,9 @@ the code also follows GlobalPlatform standards. The exceptions are as follows: deviate too much from upstream and therefore it would be hard to rebase against those projects later on and we don't expect that it is easy to convince other software projects to change coding style. + Automatic variables should always be initialized. Mixed declarations + and statements are allowed, and may be used to avoid assigning useless + values. Please leave one blank line before and after such declarations. Regarding the checkpatch tool, it is not included directly into this project. Please use checkpatch.pl from the Linux kernel git in combination with the diff --git a/core/lib/libtomcrypt/src/sub.mk b/core/lib/libtomcrypt/src/sub.mk index ca88fb1fa..328cc0014 100644 --- a/core/lib/libtomcrypt/src/sub.mk +++ b/core/lib/libtomcrypt/src/sub.mk @@ -2,7 +2,6 @@ ifdef _CFG_CRYPTO_WITH_ACIPHER srcs-y += mpa_desc.c # Get mpa.h which normally is an internal .h file cppflags-mpa_desc.c-y += -Ilib/libmpa -cflags-mpa_desc.c-y += -Wno-declaration-after-statement cflags-mpa_desc.c-y += -Wno-unused-parameter endif diff --git a/lib/libmpa/sub.mk b/lib/libmpa/sub.mk index 38c1610a9..2840f847a 100644 --- a/lib/libmpa/sub.mk +++ b/lib/libmpa/sub.mk @@ -9,7 +9,6 @@ cflags-remove-mpa_misc.c-y += -pedantic cflags-mpa_misc.c-y += -Wno-sign-compare srcs-y += mpa_montgomery.c -cflags-remove-mpa_montgomery.c-y += -Wdeclaration-after-statement srcs-y += mpa_primetest.c cflags-remove-mpa_primetest.c-y += -pedantic diff --git a/mk/compile.mk b/mk/compile.mk index 7c6c890d1..4f065a9c9 100644 --- a/mk/compile.mk +++ b/mk/compile.mk @@ -40,8 +40,7 @@ comp-cflags-warns-medium = \ -Waggregate-return -Wredundant-decls comp-cflags-warns-low = \ -Wold-style-definition -Wstrict-aliasing=2 \ - -Wundef -pedantic \ - -Wdeclaration-after-statement + -Wundef -pedantic comp-cflags-warns-1:= $(comp-cflags-warns-high) comp-cflags-warns-2:= $(comp-cflags-warns-1) $(comp-cflags-warns-medium) -- cgit v1.2.3