Enable warnings on nRF5x examples

Now all warnings are disabled on SDK files, and enabled on our
application's files.

Fixed a couple of things in nRF52 which were unnoticed because all
warnings were disabled there from the beginning.

PUBLISHED_FROM=a33ab22d0ce85efea364b80478986b88f4b0a3a2
This commit is contained in:
Dmitry Frank authored and Cesanta Bot committed 2016-11-04 19:05:54 +00:00
1 parent 7f2bdc217a
commit e69a7a1b25
6 files changed
+86 -20

No files matched your search

@@ -36,7 +36,7 @@ SIZE := "$(GNU_INSTALL_ROOT)/bin/$(GNU_PREFIX)-size"
remduplicates = $(strip $(if $1,$(firstword $1) $(call remduplicates,$(filter-out $(firstword $1),$1))))
#source common to all targets
C_SOURCE_FILES += \
C_SOURCE_FILES_SDK = \
../../../../nrf51_iot_sdk/components/libraries/button/app_button.c \
../../../../nrf51_iot_sdk/components/libraries/util/app_error.c \
../../../../nrf51_iot_sdk/components/libraries/fifo/app_fifo.c \
@@ -51,12 +51,6 @@ C_SOURCE_FILES += \
../../../../nrf51_iot_sdk/components/drivers_nrf/hal/nrf_delay.c \
../../../../nrf51_iot_sdk/components/drivers_nrf/common/nrf_drv_common.c \
../../../../nrf51_iot_sdk/components/drivers_nrf/gpiote/nrf_drv_gpiote.c \
../../../main.c \
../../../bleconfig.c \
../../../rtt/RTT/SEGGER_RTT.c \
../../../rtt/RTT/SEGGER_RTT_printf.c \
../../../rtt/Syscalls/RTT_Syscalls_GCC.c \
../../../../../../mongoose.c \
../../../../nrf51_iot_sdk/components/ble/common/ble_advdata.c \
../../../../nrf51_iot_sdk/components/ble/common/ble_srv_common.c \
../../../../nrf51_iot_sdk/components/iot/context_manager/iot_context_manager.c \
@@ -64,6 +58,16 @@ C_SOURCE_FILES += \
../../../../nrf51_iot_sdk/components/softdevice/common/softdevice_handler/softdevice_handler.c \
../../../../nrf51_iot_sdk/components/softdevice/common/softdevice_handler/softdevice_handler_appsh.c \
C_SOURCE_FILES_APP = \
../../../main.c \
../../../bleconfig.c \
../../../rtt/RTT/SEGGER_RTT.c \
../../../rtt/RTT/SEGGER_RTT_printf.c \
../../../rtt/Syscalls/RTT_Syscalls_GCC.c \
../../../../../../mongoose.c \
C_SOURCE_FILES = $(C_SOURCE_FILES_SDK) $(C_SOURCE_FILES_APP)
#assembly files common to all targets
ASM_SOURCE_FILES = ../../../../nrf51_iot_sdk/components/toolchain/gcc/gcc_startup_nrf51.s
@@ -130,7 +134,7 @@ CFLAGS += -DBLE_STACK_SUPPORT_REQD
CFLAGS += -DBSP_DEFINES_ONLY
CFLAGS += -mcpu=cortex-m0
CFLAGS += -mthumb -mabi=aapcs --std=gnu99
CFLAGS += -Wall -g3 -O3
CFLAGS += -g3 -O3
CFLAGS += -mfloat-abi=soft
# keep every function in separate section. This will allow linker to dump unused functions
CFLAGS += -ffunction-sections -fdata-sections -fno-strict-aliasing
@@ -181,6 +185,17 @@ C_SOURCE_FILE_NAMES = $(notdir $(C_SOURCE_FILES))
C_PATHS = $(call remduplicates, $(dir $(C_SOURCE_FILES) ) )
C_OBJECTS = $(addprefix $(OBJECT_DIRECTORY)/, $(C_SOURCE_FILE_NAMES:.c=.o) )
C_SOURCE_FILE_NAMES_SDK = $(notdir $(C_SOURCE_FILES_SDK))
C_SOURCE_FILE_NAMES_APP = $(notdir $(C_SOURCE_FILES_APP))
C_OBJECTS_SDK = $(addprefix $(OBJECT_DIRECTORY)/, $(C_SOURCE_FILE_NAMES_SDK:.c=.o) )
C_OBJECTS_APP = $(addprefix $(OBJECT_DIRECTORY)/, $(C_SOURCE_FILE_NAMES_APP:.c=.o) )
# Disable all warnings for SDK sources since we have no control of them
$(C_OBJECTS_SDK): CFLAGS += -w
# Enable all warnings for the application's files
$(C_OBJECTS_APP): CFLAGS += -Wall
ASM_SOURCE_FILE_NAMES = $(notdir $(ASM_SOURCE_FILES))
ASM_PATHS = $(call remduplicates, $(dir $(ASM_SOURCE_FILES) ))
ASM_OBJECTS = $(addprefix $(OBJECT_DIRECTORY)/, $(ASM_SOURCE_FILE_NAMES:.s=.o) )