summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Wiklander <jens.wiklander@linaro.org>2018-09-26 15:32:49 +0200
committerJérôme Forissier <jerome.forissier@linaro.org>2018-09-27 14:28:44 +0200
commit439203cb04cee677a6cd8bf9cb02b82d626713cc (patch)
treef139daddb8eac442584a4db881a2d3cbf67519f9
parent2197c7c208773910eafa378cbc5504cbe5d97df6 (diff)
Allow mixed declaration and code
Removes the -Wdeclaration-after-statement compiler flag to allow mixed declaration and code Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
-rw-r--r--README.md3
-rw-r--r--core/lib/libtomcrypt/src/sub.mk1
-rw-r--r--lib/libmpa/sub.mk1
-rw-r--r--mk/compile.mk3
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)