Merge branch 'fix/cppcheck' into 'master'

Fix/cppcheck



See merge request !3
This commit is contained in:
tkl 2016-07-26 21:05:29 +00:00
commit f99cce4c46
4 changed files with 25 additions and 49 deletions

View File

@ -267,7 +267,6 @@
</target> </target>
<target name="all" path="software/source/test/firmware/kernel/list" targetID="org.eclipse.cdt.build.MakeTargetBuilder"> <target name="all" path="software/source/test/firmware/kernel/list" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand> <buildCommand>make</buildCommand>
<buildArguments/>
<buildTarget>all</buildTarget> <buildTarget>all</buildTarget>
<stopOnError>true</stopOnError> <stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand> <useDefaultCommand>true</useDefaultCommand>
@ -275,7 +274,6 @@
</target> </target>
<target name="clean" path="software/source/test/firmware/kernel/list" targetID="org.eclipse.cdt.build.MakeTargetBuilder"> <target name="clean" path="software/source/test/firmware/kernel/list" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand> <buildCommand>make</buildCommand>
<buildArguments/>
<buildTarget>clean</buildTarget> <buildTarget>clean</buildTarget>
<stopOnError>true</stopOnError> <stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand> <useDefaultCommand>true</useDefaultCommand>
@ -283,7 +281,6 @@
</target> </target>
<target name="all" path="software/test/firmware/kernel/list" targetID="org.eclipse.cdt.build.MakeTargetBuilder"> <target name="all" path="software/test/firmware/kernel/list" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand> <buildCommand>make</buildCommand>
<buildArguments/>
<buildTarget>all</buildTarget> <buildTarget>all</buildTarget>
<stopOnError>true</stopOnError> <stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand> <useDefaultCommand>true</useDefaultCommand>
@ -291,7 +288,6 @@
</target> </target>
<target name="all" path="software/source/test/firmware/kernel/ringbuffer" targetID="org.eclipse.cdt.build.MakeTargetBuilder"> <target name="all" path="software/source/test/firmware/kernel/ringbuffer" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand> <buildCommand>make</buildCommand>
<buildArguments/>
<buildTarget>all</buildTarget> <buildTarget>all</buildTarget>
<stopOnError>true</stopOnError> <stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand> <useDefaultCommand>true</useDefaultCommand>
@ -299,7 +295,6 @@
</target> </target>
<target name="clean" path="software/source/test/firmware/kernel/ringbuffer" targetID="org.eclipse.cdt.build.MakeTargetBuilder"> <target name="clean" path="software/source/test/firmware/kernel/ringbuffer" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand> <buildCommand>make</buildCommand>
<buildArguments/>
<buildTarget>clean</buildTarget> <buildTarget>clean</buildTarget>
<stopOnError>true</stopOnError> <stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand> <useDefaultCommand>true</useDefaultCommand>
@ -307,36 +302,11 @@
</target> </target>
<target name="distclean" path="source" targetID="org.eclipse.cdt.build.MakeTargetBuilder"> <target name="distclean" path="source" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand> <buildCommand>make</buildCommand>
<buildArguments/>
<buildTarget>distclean</buildTarget> <buildTarget>distclean</buildTarget>
<stopOnError>true</stopOnError> <stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand> <useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders> <runAllBuilders>true</runAllBuilders>
</target> </target>
<target name="example_semaphore all" path="source" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>APP=example_semaphore BOARD=stm32f4-discovery DEBUG=y</buildArguments>
<buildTarget>all</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="example_semaphore clean" path="source" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>APP=example_semaphore BOARD=stm32f4-discovery DEBUG=y</buildArguments>
<buildTarget>clean</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="example_semaphore install" path="source" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>APP=example_semaphore BOARD=stm32f4-discovery DEBUG=y</buildArguments>
<buildTarget>install</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="test all" path="source" targetID="org.eclipse.cdt.build.MakeTargetBuilder"> <target name="test all" path="source" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand> <buildCommand>make</buildCommand>
<buildArguments> APP=test BOARD=stm32f4-discovery DEBUG=y</buildArguments> <buildArguments> APP=test BOARD=stm32f4-discovery DEBUG=y</buildArguments>
@ -353,24 +323,17 @@
<useDefaultCommand>false</useDefaultCommand> <useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders> <runAllBuilders>true</runAllBuilders>
</target> </target>
<target name="test check" path="source" targetID="org.eclipse.cdt.build.MakeTargetBuilder"> <target name="test clean" path="source" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand> <buildCommand>make</buildCommand>
<buildArguments> APP=test BOARD=stm32f4-discovery DEBUG=y</buildArguments> <buildArguments> APP=test BOARD=stm32f4-discovery DEBUG=y</buildArguments>
<buildTarget>check</buildTarget> <buildTarget>clean</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="test build" path="source" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments> APP=test BOARD=stm32f4-discovery DEBUG=y</buildArguments>
<buildTarget>build</buildTarget>
<stopOnError>true</stopOnError> <stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand> <useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders> <runAllBuilders>true</runAllBuilders>
</target> </target>
<target name="distclean" path="software/source" targetID="org.eclipse.cdt.build.MakeTargetBuilder"> <target name="distclean" path="software/source" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand> <buildCommand>make</buildCommand>
<buildArguments/>
<buildTarget>distclean</buildTarget> <buildTarget>distclean</buildTarget>
<stopOnError>true</stopOnError> <stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand> <useDefaultCommand>false</useDefaultCommand>

View File

@ -17,14 +17,13 @@ before_script:
stages: stages:
- check - check
- build - build
# - test - test
# - deploy # - deploy
build_job: build_job:
script: script:
- "cd source" - "cd source"
- "make build APP=test BOARD=stm32f4-discovery" - "make build APP=test BOARD=stm32f4-discovery"
- "make build APP=example_semaphore BOARD=stm32f4-discovery"
stage: build stage: build
except: except:
- /^release/.*$/ - /^release/.*$/
@ -33,12 +32,13 @@ check_job:
script: script:
- "cd source" - "cd source"
- "make check APP=test BOARD=stm32f4-discovery" - "make check APP=test BOARD=stm32f4-discovery"
- "make check APP=example_semaphore BOARD=stm32f4-discovery"
stage: check stage: check
#test_job: test_job:
# script: "echo test stage" script:
# stage: test - "cd source"
- "make install APP=test BOARD=stm32f4-discovery"
stage: test
#int_release_job: #int_release_job:
# script: # script:

View File

@ -15,11 +15,12 @@ CFLAGS += \
$(addprefix -I, $(INCLUDES)) \ $(addprefix -I, $(INCLUDES)) \
-Wall -Wall
CPPCHECK_FLAGS = \ CPPCHECK_FLAGS += \
--template=gcc \ --template=gcc \
--error-exitcode=1 \ --error-exitcode=1 \
--enable=warning,performance,information,style \ --enable=warning,performance,information,style \
--inline-suppr --inline-suppr \
$(addprefix -I, $(INCLUDES))
include $(ROOT_DIR)/config/make/tools.mk include $(ROOT_DIR)/config/make/tools.mk

View File

@ -7,7 +7,9 @@ CFLAGS += -DBOARD_STM32F4_DISCOVERY
endif endif
CROSS_COMPILE=arm-none-eabi- CROSS_COMPILE=arm-none-eabi-
INCLUDES := /usr/lib/arm-none-eabi/include INCLUDES += \
/usr/lib/arm-none-eabi/include \
/usr/lib/gcc/arm-none-eabi/4.8/include
ifeq ($(DEBUG),y) ifeq ($(DEBUG),y)
OPTIM = 0 OPTIM = 0
@ -33,6 +35,16 @@ CFLAGS += \
-ffunction-sections -ffunction-sections
# -D inline= -mthumb\ # -D inline= -mthumb\
CPPCHECK_FLAGS += \
-D USE_STDPERIPH_DRIVER\
-D VECT_TAB_FLASH\
-D GCC_ARMCM4\
-D THUMB_INTERWORK\
-D PACK_STRUCT_END=__attribute\(\(packed\)\)\
-D ALIGN_STRUCT_END=__attribute\(\(aligned\(4\)\)\)\
-D __thumb__ \
--check-config
LDFLAGS=\ LDFLAGS=\
-Wl,--gc-sections \ -Wl,--gc-sections \
-Xlinker -M > $(MAP_DIR)/$(APP).map -Xlinker -M > $(MAP_DIR)/$(APP).map