From 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 7 Apr 2024 13:41:34 -0500 Subject: new repository --- devdocs/c/atomic%2Fatomic_var_init.html | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 devdocs/c/atomic%2Fatomic_var_init.html (limited to 'devdocs/c/atomic%2Fatomic_var_init.html') diff --git a/devdocs/c/atomic%2Fatomic_var_init.html b/devdocs/c/atomic%2Fatomic_var_init.html new file mode 100644 index 00000000..66208dac --- /dev/null +++ b/devdocs/c/atomic%2Fatomic_var_init.html @@ -0,0 +1,24 @@ +

ATOMIC_VAR_INIT

Defined in header <stdatomic.h>
#define ATOMIC_VAR_INIT(value) /* unspecified */
+
(since C11)
(deprecated in C17)
(removed in C23)

Expands to an expression that can be used to initialize an atomic variable of the same type as value.

+

The initial value of atomic object of automatic storage duration that is not explicitly initialized is indeterminate. The default (zero) initialization of static and thread-local variables produces a valid value however.

+

When initializing an atomic variable, any concurrent access, even through an atomic operation, is a data race (it may happen if the address is immediately passed to another thread with a memory_order_relaxed operation).

+

Notes

This macro was a part of early draft design for C11 atomic types. It is not needed in C11, and is deprecated in C17 and removed in C23.

+

Defect reports

The following behavior-changing defect reports were applied retroactively to previously published C standards.

+ + + +
DR Applied to Behavior as published Correct behavior
+DR 485 C11 the specification was redundant and contradictory to the core language fixed

References

See also

+ +
+
(C11)
initializes a new atomic_flag
(macro constant)
C++ documentation for ATOMIC_VAR_INIT
+

+ © cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
+ https://en.cppreference.com/w/c/atomic/ATOMIC_VAR_INIT +

+
-- cgit v1.2.3