[cfe-dev] clang attributes to disable asan/tsan/msan

Kostya Serebryany kcc at google.com
Mon Feb 18 05:31:24 PST 2013


Clang has two attributes to disable bug detection tools in a given

__attribute__((no_thread_safety_analysis)) disables clang's *static*
thread-safety analysis. (

__attribute__((no_address_safety_analysis)) disables AddressSanitizer
(*dynamic* analysis)

Now we need two more attributes to disable
ThreadSanitizer (http://clang.llvm.org/docs/ThreadSanitizer.html)
and MemorySanitizer (http://clang.llvm.org/docs/MemorySanitizer.html)

For MemorySanitizer I propose __attribute__((no_uninitialized_checks))
Objections? Better naming suggestion?
Maybe __attribute__((no_memory_sanitizer))?
(We deliberately named no-asan attribute "no_address_safety_analysis" w/o
mentioning asan
in the name to make this attribute usable for other tools, e.g. SAFECode.
we may not want to tie the no-msan attribute to msan)

For ThreadSanitizer the question is a bit trickier.
We can reuse __attribute__((no_thread_safety_analysis)) which makes sense
because it already means a similar thing.

OTOH, most of the current uses of no_thread_safety_analysis I know about
are there because of the limitations of clang's static analysis.
And we don't need to disable ThreadSanitizer for the majority of those
which means we may better use another attribute to disable ThreadSanitizer
How to name it?

The patch discussion: http://llvm-reviews.chandlerc.com/D390


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130218/9052e401/attachment.html>

More information about the cfe-dev mailing list