ada/spark: all warnings, warn strict, style checks

* enable all common warnings through default value of CC_ADA_WARN
* treat warnings like errors through default value of CC_ADA_WARN_STRICT
* enable almost all style checks through default value of CC_ADA_WARN_STRICT
* style fixes for aes_cbc_4k
* disable strict warnings and style checks for libsparkcrypto and spark lib

Ref #3848
This commit is contained in:
Martin Stein
2019-09-29 01:49:02 +02:00
committed by Norman Feske
parent 3f97269988
commit f3eaeb08ef
15 changed files with 202 additions and 180 deletions

View File

@@ -82,6 +82,16 @@ CUSTOM_ADA_FLAGS ?= --RTS=$(ADA_RTS)
CUSTOM_ADA_OPT ?= $(CC_ADA_OPT) -gnatef
CUSTOM_ADA_INCLUDE ?= -I- $(INCLUDES)
#
# The files generated by the binder would not pass our GNAT style checks
# thus we handle them separately and disable style checks via compiler option
# '-gnatyN'
#
b~%.ali b~%.o: b~%.adb
$(MSG_COMP)$@
$(VERBOSE)$(CUSTOM_ADA_CC) $(CUSTOM_ADA_FLAGS) $(CUSTOM_ADA_OPT) -gnatyN $(CUSTOM_ADA_INCLUDE) -c $<
$(VERBOSE)$(ALI2DEP) $(dir $<) $(ALL_INC_DIR) b~$*.ali
%.ali %.o: %.adb
$(MSG_COMP)$@
$(VERBOSE)$(CUSTOM_ADA_CC) $(CUSTOM_ADA_FLAGS) $(CUSTOM_ADA_OPT) $(CUSTOM_ADA_INCLUDE) -c $<

View File

@@ -146,6 +146,12 @@ CC_WARN += -Wno-error=implicit-fallthrough
CC_CXX_WARN_STRICT ?= -Wextra -Weffc++ -Werror -Wsuggest-override
CC_CXX_WARN ?= $(CC_WARN) $(CC_CXX_WARN_STRICT)
#
# Additional warnings for Ada/SPARK
#
CC_ADA_WARN_STRICT ?= -gnatwe -gnatyyBdSux
CC_ADA_WARN ?= -gnatwa $(CC_ADA_WARN_STRICT)
#
# Aggregate compiler options that are common for C and C++
#
@@ -174,7 +180,9 @@ CC_OPT += $(CC_OPT_PIC)
#
CC_CXX_OPT += $(CC_OPT) $(CC_CXX_WARN)
CC_C_OPT += $(CC_OPT)
CC_ADA_OPT += $(filter-out -fno-builtin-cos -fno-builtin-sin -fno-builtin-cosf -fno-builtin-sinf ,$(CC_OPT)) -fexceptions
CC_ADA_OPT += $(CC_ADA_WARN) -fexceptions
CC_ADA_OPT += $(filter-out -fno-builtin-cos -fno-builtin-sin \
-fno-builtin-cosf -fno-builtin-sinf ,$(CC_OPT))
#
# Enable C++11 by default