]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
easy_lock.h: remove use of the deprecated ATOMIC_VAR_INIT macro
authorDaniel Stenberg <daniel@haxx.se>
Thu, 23 Jun 2022 10:02:32 +0000 (12:02 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 23 Jun 2022 14:17:09 +0000 (16:17 +0200)
clang 14 warns about its use. It is being deprecated by the working
group for the programming language C: "The macro ATOMIC_VAR_INIT is
basically useless for the purpose for which it was designed"

Ref: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2886.htm

Reported-by: Tatsuhiro Tsujikawa
Fixes #9041
Closes #9042

lib/easy_lock.h

index 389b2a56d2a4deaf4742e76f15c31a9ef5d0bda1..819f50ce815b8af2b7b741e2a92b0af68bb6a9a8 100644 (file)
@@ -38,7 +38,7 @@
 #include <stdatomic.h>
 
 #define curl_simple_lock atomic_bool
-#define CURL_SIMPLE_LOCK_INIT ATOMIC_VAR_INIT(false)
+#define CURL_SIMPLE_LOCK_INIT false
 
 static inline void curl_simple_lock_lock(curl_simple_lock *lock)
 {