[compiler-rt] [compiler-rt] Do not assume pthread_key_t to be a scalar type. (PR #70786)

Carlo Bramini via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 2 02:48:06 PDT 2023


carlo-bramini wrote:

> I think we should use `= {}` for clarity. (Perhaps we can/should even omit `=`.)

Actually you are right, the patch "emulated" the original code, but `pthread_key_t` is an opaque object so there is no need to set its value with a default. The current code tests if the key contains a non-NULL value, so it should be already fine since the default value of the key is `NULL` when `pthread_key_create` is called or when a new thread is created.

https://github.com/llvm/llvm-project/pull/70786


More information about the llvm-commits mailing list