Added the compile and link flag '-fsanitize=' to solve issue #19

This commit is contained in:
Ian A. Mason 2018-05-13 07:42:20 -07:00
parent a91293a16f
commit da2306f5bc
3 changed files with 25 additions and 0 deletions

20
examples/issue19/Makefile Normal file
View File

@ -0,0 +1,20 @@
one:
${CC} test.c -fsanitize=address -o test
test.o:
${CC} -c test.c -fsanitize=address
test: test.o
${CC} test.o -fsanitize=address -o test
clean:
rm -f test.o test .test* *~

4
examples/issue19/test.c Normal file
View File

@ -0,0 +1,4 @@
#include <stdio.h>
int main(void) {
printf("test\n");
}

View File

@ -263,6 +263,7 @@ func parse(argList []string) parserResult {
`^-U.+$`: {0, pr.compileUnaryCallback}, `^-U.+$`: {0, pr.compileUnaryCallback},
`^-Wl,.+$`: {0, pr.linkUnaryCallback}, `^-Wl,.+$`: {0, pr.linkUnaryCallback},
`^-W[^l].*$`: {0, pr.compileUnaryCallback}, `^-W[^l].*$`: {0, pr.compileUnaryCallback},
`^-fsanitize=.+$`: {0, pr.compileLinkUnaryCallback},
`^-f.+$`: {0, pr.compileUnaryCallback}, `^-f.+$`: {0, pr.compileUnaryCallback},
`^-rtlib=.+$`: {0, pr.linkUnaryCallback}, `^-rtlib=.+$`: {0, pr.linkUnaryCallback},
`^-std=.+$`: {0, pr.compileUnaryCallback}, `^-std=.+$`: {0, pr.compileUnaryCallback},