[ovs-git] [openvswitch/ovs] aae08a: include/windows/unistd.h: Fixed type cast warning ...

Ilya Maximets noreply at github.com
Wed Sep 15 23:06:56 UTC 2021


  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: aae08a577ddbaed437bb10794c4aa4158fb77d8d
      https://github.com/openvswitch/ovs/commit/aae08a577ddbaed437bb10794c4aa4158fb77d8d
  Author: Sergey Madaminov <sergey.madaminov at gmail.com>
  Date:   2021-09-16 (Thu, 16 Sep 2021)

  Changed paths:
    M include/windows/unistd.h

  Log Message:
  -----------
  include/windows/unistd.h: Fixed type cast warning on Windows.

Currently, the function call type cast for getting file handle
produces a warning during OvS compilation on Windows with the following
message:

 ..\include\windows\unistd.h:97:25: warning:
 cast from function call of type 'intptr_t' (aka 'int') to non-matching
 type 'HANDLE' (aka 'void *') [-Wbad-function-cast]
     HANDLE h = (HANDLE) _get_osfhandle(fd);

There is a function `LongToHandle()` to perform such cast [1].
But as `intptr_t` can be either `long long` for 64-bit or `int` for
32-bit, instead of clogging the code with `#ifdef` macros to use
different cast functions, we can perform this cast directly.

Signed-off-by: Sergey Madaminov <sergey.madaminov at gmail.com>
Acked-by: Michael Santana <msantana at redhat.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>


  Commit: ee74a8b75804eb818a176b1651069268b7652d14
      https://github.com/openvswitch/ovs/commit/ee74a8b75804eb818a176b1651069268b7652d14
  Author: Ilya Maximets <i.maximets at ovn.org>
  Date:   2021-09-16 (Thu, 16 Sep 2021)

  Changed paths:
    M AUTHORS.rst

  Log Message:
  -----------
  AUTHORS: Add Sergey Madaminov.

Signed-off-by: Ilya Maximets <i.maximets at ovn.org>


Compare: https://github.com/openvswitch/ovs/compare/e05e1e3c056e...ee74a8b75804


More information about the git mailing list