[cfe-dev] Clang Thread Safety Annotations Current Status.

Austin Seipp aseipp at pobox.com
Thu Jul 11 18:30:39 PDT 2013


You need to use -Wthread-safety.

On Thu, Jul 11, 2013 at 8:27 PM, Ethan Jackson <ethan at nicira.com> wrote:
> Perhaps I'm missing something then.  I compiled the following program:
>
> static int x __attribute__((guarded_var));
>
> int
> main(int argc, char *argv[])
> {
>     x = 1;
>     x = 0;
>     return x;
> }
>
> With these options: clang -O0 -Wall -Werror
>
> Using the clang-3.4 I got from here:
>
> deb http://llvm.org/apt/precise/ llvm-toolchain-precise main
> deb-src http://llvm.org/apt/precise/ llvm-toolchain-precise main
>
> Which I was lead to believe is a nightly build.
>
> I would expect this program to fail to compile because I don't take a
> lock when accessing "x", but it seems to work fine.  Perhaps there's
> some command line magic I'm missing?  Or perhaps I need to manually
> build off trunk?
>
> Ethan
>
> On Thu, Jul 11, 2013 at 6:18 PM, David Blaikie <dblaikie at gmail.com> wrote:
>>
>> On Jul 11, 2013 1:48 PM, "Ethan Jackson" <ethan at nicira.com> wrote:
>>>
>>> Hello,
>>>
>>> I'm currently playing around with the clang thread safety annotations
>>> in the hopes of using them in the Open vSwitch project.  Looks like
>>> the parsing of the annotations is implemented and merged into trunk,
>>> but (as documented) they do nothing yet.  Is there a public
>>> development branch floating around which contains implementations for
>>> these?  If so how stable is it?
>>
>> No branch, its on tot as far as I know. Have you tried them? I'm pretty sure
>> they're working and the docs are just out of date.
>>
>>>
>>> Thanks in advance for the help,
>>> Ethan
>>> _______________________________________________
>>> cfe-dev mailing list
>>> cfe-dev at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev



-- 
Regards,
Austin - PGP: 4096R/0x91384671



More information about the cfe-dev mailing list