Skip to content
Snippets Groups Projects
Commit d0294dd7 authored by René Kijewski's avatar René Kijewski
Browse files

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
parent 6c61266b
Branches
No related tags found
No related merge requests found
...@@ -56,7 +56,9 @@ CFLAGS += -fno-common ...@@ -56,7 +56,9 @@ CFLAGS += -fno-common
CFLAGS += -Wall CFLAGS += -Wall
ifeq (,$(filter -DDEVELHELP,$(CFLAGS))) ifeq (,$(filter -DDEVELHELP,$(CFLAGS)))
CFLAGS += -DNDEBUG ifneq (1,$(FORCE_ASSERTS))
CFLAGS += -DNDEBUG
endif
endif endif
# Default ARFLAGS for platforms which do not specify it. # Default ARFLAGS for platforms which do not specify it.
......
...@@ -70,7 +70,7 @@ scan-build-analyze: clean ...@@ -70,7 +70,7 @@ scan-build-analyze: clean
$(AD)mkdir -p '$(SCANBUILD_OUTPUTDIR)' $(AD)mkdir -p '$(SCANBUILD_OUTPUTDIR)'
$(AD)env -i $(ENVVARS) \ $(AD)env -i $(ENVVARS) \
scan-build -o '$(SCANBUILD_OUTPUTDIR)' $(SCANBUILD_ARGS) \ 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 endif # BUILD_IN_DOCKER
ifeq (1,$(INSIDE_DOCKER)) ifeq (1,$(INSIDE_DOCKER))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment