2016-02-11 81 views
0

是否有任何機會禁用牙山的終端顏色輸出?無論我通過它的標誌,它打印終端顏色代碼:在地址清潔劑輸出中禁用顏色

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

進入color=never添加到環境變量ASAN_OPTIONS

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

呵呵,看來我錯過了。完美的作品! – HelloWorld