<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>Le 18 févr. 2013 à 14:31, Kostya Serebryany <<a href="mailto:kcc@google.com">kcc@google.com</a>> a écrit :</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">Hi, <div><br></div><div>Clang has two attributes to disable bug detection tools in a given function: </div><div><br></div><div>__attribute__((no_thread_safety_analysis)) disables clang's *static* thread-safety analysis. (<a href="http://clang.llvm.org/docs/LanguageExtensions.html#thread-safety-annotation-checking">http://clang.llvm.org/docs/LanguageExtensions.html#thread-safety-annotation-checking</a>)</div>
<div style=""><br></div><div style="">__attribute__((no_address_safety_analysis)) disables AddressSanitizer (*dynamic* analysis)<br></div><div><div><a href="http://clang.llvm.org/docs/LanguageExtensions.html#extensions-for-dynamic-analysis">http://clang.llvm.org/docs/LanguageExtensions.html#extensions-for-dynamic-analysis</a><br>
</div><div><br></div><div>Now we need two more attributes to disable <br></div><div style="">ThreadSanitizer (<a href="http://clang.llvm.org/docs/ThreadSanitizer.html">http://clang.llvm.org/docs/ThreadSanitizer.html</a>)</div>
<div style="">and MemorySanitizer (<a href="http://clang.llvm.org/docs/MemorySanitizer.html">http://clang.llvm.org/docs/MemorySanitizer.html</a>)</div><div><br></div><div style="">For MemorySanitizer I propose __attribute__((no_uninitialized_checks))</div>
<div style="">Objections? Better naming suggestion?</div><div style="">Maybe __attribute__((no_memory_sanitizer))?</div><div style="">(We deliberately named no-asan attribute "no_address_safety_analysis" w/o mentioning asan</div>
<div style="">in the name to make this attribute usable for other tools, e.g. SAFECode. So, </div><div style="">we may not want to tie the no-msan attribute to msan)</div><div style=""><br></div><div style="">For ThreadSanitizer the question is a bit trickier. </div>
<div style="">We can reuse __attribute__((no_thread_safety_analysis)) which makes sense</div><div style="">because it already means a similar thing.</div><div style=""><br></div><div style="">OTOH, most of the current uses of no_thread_safety_analysis I know about </div>
<div style="">are there because of the limitations of clang's static analysis. </div><div style="">And we don't need to disable ThreadSanitizer for the majority of those cases,</div><div style="">which means we may better use another attribute to disable ThreadSanitizer checking. </div>
<div style="">How to name it? </div><div style="">__attribute__((no_thread_sanitizer))?<br></div><div style="">__attribute__((no_dynamic_thread_safety_analysis))?<br></div><div style="">__attribute__((thread_sanitizer_ignore_plain_memory_accesses))<br></div></div></div></blockquote><div><br></div>Just a though, but instead of creating new attribute for each analyze, wouldn't it be possible to define a single parameterized attribute which would take parameters similar to the one passed to the --sanitize option ?<br><blockquote type="cite"><div dir="ltr"><div><div style="">
</div></div></div></blockquote></div><div><br></div><div>__attribute__((safety_analysis("memory", "thread", …)))</div><div><br></div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px; "><div>-- Jean-Daniel</div><div><br></div><div><br></div></span><br class="Apple-interchange-newline">

</div>
<br></body></html>