0

Is there any chance to disable the terminal color output of Asan? No matter which flags I pass, it prints terminal color codes:

  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

The arguments I tried out:

clang++ -fsanitize=address -fno-color-diagnostics ...
clang++ -fsanitize=address -fcolor-diagnostics=never ...
clang++ -fsanitize=address -fdiagnostics-color=never ...

What do I miss? Is there maybe an API I can use to turn it off?

HelloWorld
  • 2,392
  • 3
  • 31
  • 68

1 Answers1

2

Add the entry color=never to the environment variable ASAN_OPTIONS:

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