smadaminov / ovs-dpdk-meson-issues

VMware Summer 2021
BSD 3-Clause "New" or "Revised" License
1 stars 1 forks source link

[-Wbad-function-cast] in `..\include\windows\unistd.h` for HANDLE #61

Closed smadaminov closed 2 years ago

smadaminov commented 2 years ago

Warning during compilation on Windows. Both 32-bit and 64-bit produce a warning though with different types.

..\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);
smadaminov commented 2 years ago

Using proper casting fixes this proper and works for both 32- and 64- bit systems: HANDLE h = (HANDLE)(INT_PTR) _get_osfhandle(fd);

local patch name: 0001-issue-61-fix-handle-pointer-casting.patch

submitted patch and it was acked: http://patchwork.ozlabs.org/project/openvswitch/patch/20210826154557.1226-1-sergey.madaminov@gmail.com/

smadaminov commented 2 years ago

patch has been accepted

http://patchwork.ozlabs.org/project/openvswitch/patch/20210826154557.1226-1-sergey.madaminov@gmail.com/