smadaminov / ovs-dpdk-meson-issues

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

static_assert_expression error #59

Open ua1422 opened 2 years ago

ua1422 commented 2 years ago

[13/267] Compiling C object utilities/ovs-testcontroller.exe.p/ovs-testcontroller.c.obj FAILED: utilities/ovs-testcontroller.exe.p/ovs-testcontroller.c.obj "clang" "-Iutilities\ovs-testcontroller.exe.p" "-Iutilities" "-I..\utilities" "-I." "-I.." "-Iinclude" "-I..\include" "-Ilib" "-I..\lib" "-I..\include\windows" "-I..\datapath-windows\include" "-IC:\pthreads\pthreads4w_source" "-IC:\pthreads\pthreads4w_source\include" "-fcolor-diagnostics" "-D_FILE_OFFSET_BITS=64" "-Wall" "-Winvalid-pch" "-O3" "-Wstrict-prototypes" "-Wall" "-Wextra" "-Wno-sign-compare" "-Wpointer-arith" "-Wformat" "-Wformat-security" "-Wswitch-enum" "-Wunused-parameter" "-Wbad-function-cast" "-Wcast-align" "-Wstrict-prototypes" "-Wold-style-definition" "-Wmissing-prototypes" "-Wmissing-field-initializers" "-fno-strict-aliasing" "-Wswitch-bool" "-Wlogical-not-parentheses" "-Wsizeof-array-argument" "-Wshift-negative-value" "-Wshadow" "-Wno-null-pointer-arithmetic" -MD -MQ utilities/ovs-testcontroller.exe.p/ovs-testcontroller.c.obj -MF "utilities\ovs-testcontroller.exe.p\ovs-testcontroller.c.obj.d" -o utilities/ovs-testcontroller.exe.p/ovs-testcontroller.c.obj "-c" ../utilities/ovs-testcontroller.c In file included from ../utilities/ovs-testcontroller.c:20: In file included from ..\include\windows\getopt.h:33: ..\include\windows\unistd.h:97:25: warning: cast from function call of type 'intptr_t' (aka 'long long') to non-matching type 'HANDLE' (aka 'void ') [-Wbad-function-cast] HANDLE h = (HANDLE) _get_osfhandle(fd); ^~~~~~ In file included from ../utilities/ovs-testcontroller.c:32: In file included from ..\lib\ofp-version-opt.h:5: ..\lib/util.h:79:32: warning: unused parameter 'start' [-Wunused-parameter] ovs_prefetch_range(const void start, size_t size) ^ In file included from ../utilities/ovs-testcontroller.c:42: In file included from ..\include\openvswitch/ofp-flow.h:23: In file included from ..\include\openvswitch/match.h:20: In file included from ..\include\openvswitch/flow.h:20: In file included from ..\include\openvswitch/packets.h:22: ..\include\openvswitch/tun-metadata.h:66:19: error: static_assert expression is not an integral constant expression

I have been using the following workaround on the suggestion of the author:

As a temporary fix "include\openvswitch\compiler.h" comment the following piece of code (around line 250):

248 #if _MSC_VER >= 1900 249 #undef offsetof 250 #define offsetof(type, member) \ 251 ((size_t)((char )&(((type )0)->member) - (char *)0)) 252 #endif