[ovs-git] [openvswitch/ovs] b816a9: ovs-atomic-msvc: Disable a compiler warning.

GitHub noreply at github.com
Mon Sep 15 21:57:53 UTC 2014


  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: b816a953da5937a63f8d62af9317b92953d9c24f
      https://github.com/openvswitch/ovs/commit/b816a953da5937a63f8d62af9317b92953d9c24f
  Author: Gurucharan Shetty <gshetty at nicira.com>
  Date:   2014-09-15 (Mon, 15 Sep 2014)

  Changed paths:
    M lib/ovs-atomic-msvc.h

  Log Message:
  -----------
  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 <gshetty at nicira.com>
Acked-by: Eitan Eliahu <eliahue at vmware.com>


  Commit: 355ead69010c123475a9d2ade23b1cc667d868cb
      https://github.com/openvswitch/ovs/commit/355ead69010c123475a9d2ade23b1cc667d868cb
  Author: Gurucharan Shetty <gshetty at nicira.com>
  Date:   2014-09-15 (Mon, 15 Sep 2014)

  Changed paths:
    M lib/ofp-actions.c
    M ovsdb/query.c

  Log Message:
  -----------
  Fix remaining "void function returning a value" warning by MSVC.

MSVC complains about a void function returning a value if there is a
statement of the form - 'return foo()' even if foo() has a void return
type.

Signed-off-by: Gurucharan Shetty <gshetty at nicira.com>
Acked-by: Ben Pfaff <blp at nicira.com>


  Commit: d72eff6cec01187d9b6b0f8befdbdec0943e6012
      https://github.com/openvswitch/ovs/commit/d72eff6cec01187d9b6b0f8befdbdec0943e6012
  Author: Gurucharan Shetty <gshetty at nicira.com>
  Date:   2014-09-15 (Mon, 15 Sep 2014)

  Changed paths:
    M ofproto/ofproto-dpif-upcall.c
    M tests/test-cmap.c

  Log Message:
  -----------
  Fix remaining "uninitialized local variable" used warning by MSVC.

Signed-off-by: Gurucharan Shetty <gshetty at nicira.com>
Acked-by: Ben Pfaff <blp at nicira.com>


Compare: https://github.com/openvswitch/ovs/compare/b7ccaf673e76...d72eff6cec01


More information about the git mailing list