aaronpuchert wrote:

> One thought --- you could consider an attribute that could be put on pointer 
> arguments to functions that says "yes, I dereference this and read or write 
> it".

GCC [has such an 
attribute](https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-access-function-attribute),
 independent of Thread Safety Analysis. But I don't think we have an equivalent.

However, as I wrote above, it's probably the rule and not the exception that 
pointers passed into a function are dereferenced at some point. So we're 
probably fine if we always warn. And as @melver pointed out, the experience 
with reference passing in C++ has been pretty good, and it's probably 
transferable to pointers.

https://github.com/llvm/llvm-project/pull/123063
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to