有没有机会禁用Asan的终端颜色输出?无论我传递哪个标志,它都会打印终端颜色代码:
Heap left redzone: [1m[31mfa[1m[0m
Freed heap region: [1m[35mfd[1m[0m
Stack left redzone: [1m[31mf1[1m[0m
Stack mid redzone: [1m[31mf2[1m[0m
Stack right redzone: [1m[31mf3[1m[0m
Stack partial redzone: [1m[31mf4[1m[0m
Stack after return: [1m[35mf5[1m[0m
我试过的论点:
clang++ -fsanitize=address -fno-color-diagnostics ...
clang++ -fsanitize=address -fcolor-diagnostics=never ...
clang++ -fsanitize=address -fdiagnostics-color=never ...
我想念什么?可能有一个我可以用来关闭它的API吗?
答案 0 :(得分:1)
将条目color=never添加到环境变量ASAN_OPTIONS
:
$ clang++-3.6 -O -g -fsanitize=address test.cpp
$ ASAN_OPTIONS="color=never" ./a.out