mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-02-21 13:16:57 +00:00
__atomic_compare_exchange() is incorrectly documented in the gcc builtins doc, it says the desired value is "type *desired" while in reality it is "const type *desired" as expected since that value must in no way be modified by the operation. However it seems that clang has implemented it as documented, and reports build warnings when fed a const. This is quite problematic because it means we have to betry the callers, pretending we won't touch their constants but not knowing what the compiler would do with them, and possibly hiding future bugs. Instead of forcing a cast, let's just switch to the better __atomic_compare_exchange_n() that takes a value instead of a pointer. At least with this one there is no doubt about how the input will be used. It was verified that the output object code is the same both in clang and gcc with this change. |
||
---|---|---|
.. | ||
haproxy | ||
import |