Open williamtu opened 3 years ago
use uintptr_t
diff --git a/lib/odp-util.c b/lib/odp-util.c
index 7729a9060..80b879225 100644
--- a/lib/odp-util.c
+++ b/lib/odp-util.c
@@ -5486,7 +5486,7 @@ gtpu_to_attr(struct ofpbuf *a, const void *data_)
#define SCAN_PUT_ATTR(BUF, ATTR, DATA, FUNC) \
{ \
- unsigned long call_fn = (unsigned long)FUNC; \
+ uintptr_t call_fn = (uintptr_t)FUNC; \
if (call_fn) { \
typedef void (*fn)(struct ofpbuf *, const void *); \
fn func = FUNC; \
[87/252] Compiling C object lib/libopenvswitch.a.p/odp-util.c.obj FAILED: lib/libopenvswitch.a.p/odp-util.c.obj "clang" "-Ilib\libopenvswitch.a.p" "-Ilib" "-I..\lib" "-I." "-I.." "-Iinclude\openflow" "-I..\include\openflow" "-Iinclude\openvswitch" "-I..\include\openvsw itch" "-I..\include\windows" "-Iinclude" "-I..\include" "-I..\datapath-windows\include" "-IC:\PTHREADS-BUILT\include" "-Xclang" "-fcolor-diagnostics" "-pipe" "-D_FILE_OFFSET_BITS=64" "-Wall" "-Winvalid-pch" "-g" "-Wthread-safety" "-Wno-microsoft-enum-forward-reference" "-Wno-unused-function" "-Wno-sometimes-unini tialized" "-Wno-format" "-Wno-incompatible-pointer-types" "-Werror" "-dM" "-U_MSC_VER" "-D_TIMESPEC_DEFINED" "-D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_SECURE_NO_WA RNINGS" "-D_CRT_SECURE_NO_DEPRECATE" -MD -MQ lib/libopenvswitch.a.p/odp-util.c.obj -MF "lib\libopenvswitch.a.p\odp-util.c.obj.d" -o lib/libopenvswitch.a.p/od p-util.c.obj "-c" ../lib/odp-util.c ../lib/odp-util.c:5834:5: error: cast to smaller integer type 'unsigned long' from 'void ' [-Werror,-Wvoid-pointer-to-int-cast] SCAN_SINGLE("skb_priority(", uint32_t, u32, OVS_KEY_ATTR_PRIORITY); ^
~~~~~~~~~~~~~../lib/odp-util.c:5665:7: note: expanded from macro 'SCAN_SINGLE' } SCAN_END_SINGLE(ATTR) ^~~~~../lib/odp-util.c:5658:9: note: expanded from macro 'SCAN_END_SINGLE' SCAN_PUT(ATTR, NULL); \ ^~~~~~~~ ../lib/odp-util.c:5601:9: note: expanded from macro 'SCAN_PUT' SCAN_PUT_ATTR(key, ATTR, skey, FUNC); \ ^~~~~~~~../lib/odp-util.c:5489:33: note: expanded from macro 'SCAN_PUT_ATTR' unsigned long call_fn = (unsigned long)FUNC; \ ^~~~~~~ ../lib/odp-util.c:5834:5: error: cast to smaller integer type 'unsigned long' from 'void ' [-Werror,-Wvoid-pointer-to-int-cast] SCAN_SINGLE("skb_priority(", uint32_t, u32, OVS_KEY_ATTR_PRIORITY); ^~~~~~~~~~~~~~../lib/odp-util.c:5665:7: note: expanded from macro 'SCAN_SINGLE' } SCAN_END_SINGLE(ATTR) ^~~~~../lib/odp-util.c:5658:9: note: expanded from macro 'SCAN_END_SINGLE' SCAN_PUT(ATTR, NULL); \ ^~~~~~~~ ../lib/odp-util.c:5603:13: note: expanded from macro 'SCAN_PUT' SCAN_PUT_ATTR(mask, ATTR, smask, FUNC); \ ^~~~~~~~~~