Details
-
Bug
-
Resolution: Fixed
-
Major - P3
-
None
-
None
-
Fully Compatible
-
ALL
-
Dev Tools 2018-12-31, Dev Tools 2019-01-14
Description
In a few places, the header uses identifiers with leading underscore and capital letter, which are reserved.
_ATOMIC_WORD_DECLARE(AtomicUInt32, unsigned);
_ATOMIC_WORD_DECLARE(AtomicUInt64, unsigned long long);
_ATOMIC_WORD_DECLARE(AtomicInt32, int);
_ATOMIC_WORD_DECLARE(AtomicInt64, long long);
_ATOMIC_WORD_DECLARE(AtomicBool, bool);
People think AtomicInt32 wraps int32_t and it doesn't.
This is benign for the AtomicInt32 case, because it's easy to believe that and still be right because 'int32_t' is 'int'.
But for the 64-bit cases, you'll be wrong sometimes. e.g. std::int64_t is long on Linux. It's only long long on Windows.
Also we don't need the _ATOMIC_WORD_DECLARE structure.
All it's doing is providing static asserts that could be inside the AtomicWord class.