[cfe-dev] Using "unknown" cxx11 attributes to flag declarations

Patrick Gartung gartung at fnal.gov
Wed Nov 20 05:27:49 PST 2013


Hi Alexey,

We have not tried ThreadSanitizer. Thanks for the suggestion.

I think the solution to my original question is to add an attribute that 
can be attached to declarations when [[cms::threadsafe]] appears in the 
code.

Patrick

On 11/20/2013 1:47 AM, Alexey Samsonov wrote:
> Hi Patrick,
>
> On Tue, Nov 19, 2013 at 9:27 PM, Patrick Gartung <gartung at fnal.gov 
> <mailto:gartung at fnal.gov>> wrote:
> > Hi,
> >
> > We are  working on a project to make a large code base thread safe.
>
> Out of curiosity, did you try ThreadSanitizer 
> <http://clang.llvm.org/docs/ThreadSanitizer.html> on your code base? 
> It's able to report
> data races which are hard to detect statically.
>
> > 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:
> >
> > func_checker.cpp:8:4: warning: unknown attribute 'threadsafe' ignored
> > [[ cms::threadsafe ]] void bar() {
> >
> > We would like to store the contents of the unknown attribute and 
> drop static
> > analyzer reports based on it.
> >
> > Is there support for this in the head version of clang?
> >
> > Patrick Gartung
> >
> >
> >
> > _______________________________________________
> > cfe-dev mailing list
> > cfe-dev at cs.uiuc.edu <mailto:cfe-dev at cs.uiuc.edu>
> > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
> >
>
>
>
> -- 
> Alexey Samsonov, MSK

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20131120/8972e658/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3524 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20131120/8972e658/attachment.bin>


More information about the cfe-dev mailing list