禁用地址清理器输出中的颜色

时间:2016-02-11 13:16:18

标签: colors terminal clang address-sanitizer

有没有机会禁用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吗?

1 个答案:

答案 0 :(得分:1)

将条目color=never添加到环境变量ASAN_OPTIONS

$ clang++-3.6 -O -g -fsanitize=address test.cpp
$ ASAN_OPTIONS="color=never" ./a.out