From 5f801b03125876277eefb196dac13a4208a89af8 Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Thu, 13 Apr 2017 23:04:47 +0200 Subject: [PATCH] Add santize static analyse --- tests/Makefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/Makefile b/tests/Makefile index 7f44dfc1..a9657f7c 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -1,6 +1,8 @@ #NOTE: GMP is only used for the tests CC=gcc -std=c99 -CFLAGS=-Wall -W -pedantic -Wshadow -Wpointer-arith -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wswitch-default -Wswitch-enum -Wcast-align -Wpointer-arith -Wbad-function-cast -Wstrict-overflow=5 -Wstrict-prototypes -Winline -Wundef -Wnested-externs -Wcast-qual -Wshadow -Wunreachable-code -Wlogical-op -Wstrict-aliasing=2 -Wredundant-decls -Wold-style-definition -Wno-unused-function -DSTART_COVERAGE="" -DEND_COVERAGE="" +WCFLAGS=-Wall -W -pedantic -Wshadow -Wpointer-arith -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wswitch-default -Wswitch-enum -Wcast-align -Wpointer-arith -Wbad-function-cast -Wstrict-overflow=5 -Wstrict-prototypes -Winline -Wundef -Wnested-externs -Wcast-qual -Wshadow -Wunreachable-code -Wlogical-op -Wstrict-aliasing=2 -Wredundant-decls -Wold-style-definition -Wno-unused-function -DSTART_COVERAGE="" -DEND_COVERAGE="" +XCFLAGS= +CFLAGS=$(WCFLAGS) $(XCFLAGS) CPPFLAGS=-I.. RM=rm -f VALGRIND= @@ -104,5 +106,9 @@ valgrind: make check VALGRIND=valgrind scan-build: - rm -rf ./mlib-report + $(RM) -rf ./mlib-report scan-build -o ./mlib-report make check + +sanitize: + make check XCFLAGS="-fsanitize=address,undefined" + make check XCFLAGS="-fsanitize=thread"