1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

make: enable assert() in make scan-build

Compare scan-build's [documentation][1]:

> ALWAYS analyze a project in its "debug" configuration
>
> Most projects can be built in a "debug" mode that enables assertions.
> Assertions are picked up by the static analyzer to prune infeasible
> paths, which in some cases can greatly reduce the number of false
> positives (bogus error reports) emitted by the tool.

Closes #3960.

  1: http://clang-analyzer.llvm.org/scan-build.html#recommended_debug
This commit is contained in:
René Kijewski 2015-09-24 23:51:05 +02:00
parent 6c61266bed
commit d0294dd70e
2 changed files with 4 additions and 2 deletions

View File

@ -56,7 +56,9 @@ CFLAGS += -fno-common
CFLAGS += -Wall
ifeq (,$(filter -DDEVELHELP,$(CFLAGS)))
CFLAGS += -DNDEBUG
ifneq (1,$(FORCE_ASSERTS))
CFLAGS += -DNDEBUG
endif
endif
# Default ARFLAGS for platforms which do not specify it.

View File

@ -70,7 +70,7 @@ scan-build-analyze: clean
$(AD)mkdir -p '$(SCANBUILD_OUTPUTDIR)'
$(AD)env -i $(ENVVARS) \
scan-build -o '$(SCANBUILD_OUTPUTDIR)' $(SCANBUILD_ARGS) \
make -C $(CURDIR) all $(strip $(CMDVARS));
make -C $(CURDIR) all $(strip $(CMDVARS)) FORCE_ASSERTS=1;
endif # BUILD_IN_DOCKER
ifeq (1,$(INSIDE_DOCKER))