[cfe-dev] Questions regarding source modification of clang's integer sanitization

Richard Smith richard at metafoo.co.uk
Mon May 13 17:43:57 PDT 2013

On Mon, May 13, 2013 at 3:40 PM, Kangkook Jee <aixer77 at gmail.com> wrote:

> Hi, all
> I want to make a couple of small modiciation to clang source base so that
> it can fit into my project.
> (1) I want to set '-fsanitize=integer' as default action, so that the
> option is turned on always.

Maybe you could add this to your CFLAGS, or if you can't do that, then make
a wrapper for the clang binary which adds it?

> (2) I want to change the format of the error message emitted upon
> detection and redirect it to a specific file (not stderr or stdout).

In "sanitizer/common_interface_defs.h", you can find this:

extern "C" void __sanitizer_set_report_path(const char *path);

Call it before your program would emit any sanitizer diagnostics, and they
should go to the filename you provide.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130513/7311ae16/attachment.html>

More information about the cfe-dev mailing list