[[Clang] Why is Clang still emitting thread safety warnings when I annotate methods with no_thread_safety_analysis

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[[Clang] Why is Clang still emitting thread safety warnings when I annotate methods with no_thread_safety_analysis

Manuel Klimek via cfe-dev
[Here](https://github.com/netheril96/securefs/blob/15b36a894442019bba1466bebe3aa06973a77143/sources/commands.cpp#L128)
is the file where I annotate a method with `no_thread_safety_analysis`
(the macro definition is
[here](https://github.com/netheril96/securefs/blob/15b36a894442019bba1466bebe3aa06973a77143/external/thread_safety_annotations.hpp#L58).

When I compile the file with `-Wthread-safety
-Wthread-safety-negative`, clang still emits tons of warnings, such as

```
calling function 'remove_entry' requires holding mutex 'dir->m_lock'
exclusively [-Wthread-safety-analysis]
```

Why?

My environment is clang 11.0 on Ubuntu 19.10.
_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev