<div dir="ltr">On Tue, Nov 19, 2013 at 9:27 AM, Patrick Gartung <span dir="ltr"><<a href="mailto:gartung@fnal.gov" target="_blank">gartung@fnal.gov</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi,<br>
<br>
We are  working on a project to make a large code base thread safe. We have several clang static analyzers that we use to identify thread safety problems. As we fix these problems we would like to use cxx11 attributes to flag them complete, eg void * foo () -->> [cms::threadsafe] void * foo(). Initial tests we release 3.3 show that the parse throws a warning and drops the info:<br>

<br>
func_checker.cpp:8:4: warning: unknown attribute 'threadsafe' ignored<br>
[[ cms::threadsafe ]] void bar() {<br>
<br>
We would like to store the contents of the unknown attribute and drop static analyzer reports based on it.<br>
<br>
Is there support for this in the head version of clang?</blockquote><div><br></div><div>No, but it would be straightforward to preserve unknown attributes. That said, it'd also be trivial for you to make a local modification and build a custom clang that supported your attribute, if that's the way you want to go. (In the longer term, we may want plugins to be able to add their own attributes, but we don't really have a design for that yet, nor anyone pushing it.)</div>
<div><br></div><div>Also, have you investigated clang's thread safety annotations? They're an attribute syntax designed for identifying thread safety problems; there may be substantial overlap with your approach. They're documented here: <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></div></div>