Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ovs-atomic-msvc: Disable a compiler warning.
MSVC does not support c11 style atomics for the C compiler. Windows has different InterLocked* functions for different data sizes. ovs-atomic-msvc.h maps the api in ovs-atomic.h (which is similar to c11 atomics) to the available atomic functions in Windows. In some cases, this causes compiler warnings about mismatched data sizes because the generated code has 'if else' conditions on different data sizes and proper casting is not possible. In current OVS code base, we get one compiler warning through ovs-rcu.h which says "‘void *’ differs in levels of indirection from LONGLONG." This comes from the following in ovs-atomic-msvc.h for atomic_read64(): *(DST) = InterlockedOr64((int64_t volatile *) (SRC), 0); when *DST is a void pointer (because InterLockedOr64 returns LONGLONG). But this code path is only every hit for 64 bit data. So it should be safe to disable the warning. (Any real bugs in api calls would hopefully be caught while compiling on Linux using gcc/clang). Signed-off-by: Gurucharan Shetty <[email protected]> Acked-by: Eitan Eliahu <[email protected]>
- Loading branch information