This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
colors in `-fsanitize=bounds' and UBSAN_OPTIONS
- From: Alexander Klimov <alserkli at inbox dot ru>
- To: gcc at gcc dot gnu dot org
- Date: Mon, 19 Jan 2015 19:47:52 +0200
- Subject: colors in `-fsanitize=bounds' and UBSAN_OPTIONS
- Authentication-results: sourceware.org; auth=none
I compile and run my program inside Emacs (M-x compile) with
gcc 5.0.0 20150112 using `-fsanitize=bounds'. Although
this Emacs buffer is technically a tty, but it is `dumb' and does not
handle colors properly.
The gcc info concerning `-fsanitize=address' hints that there is a
parameter ASAN_OPTIONS and the referenced wiki of address-sanitizer
says that this environment variable can be used to disable the colors.
Unfortunately and very confusingly, this hint does not help with
`-fsanitize=bounds', since it uses UBSAN_OPTIONS instead.
I guess the gcc info should be updated to mention UBSAN_OPTIONS.
It would be nice to port the terminal color capability detection code
from gcc to sanitizer, since gcc itself colorizes the error messages
properly: by default the colors are on in `xterm', and off in `dumb'.
--
Regards,
ASK