[ovs-dev] [PATCH 2/2] ovs-dpctl: Suppress compiler warning on 64 bit linux.

Ethan Jackson ethan at nicira.com
Thu Nov 17 23:29:10 UTC 2011


utilities/ovs-dpctl.c:851:42: error: cast to pointer from integer
of different size [-Werror=int-to-pointer-cast]
---
 utilities/ovs-dpctl.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/utilities/ovs-dpctl.c b/utilities/ovs-dpctl.c
index 5fa6fb7..56d648c 100644
--- a/utilities/ovs-dpctl.c
+++ b/utilities/ovs-dpctl.c
@@ -848,7 +848,8 @@ do_normalize_actions(int argc, char *argv[])
         int n = -1;
 
         if (sscanf(argv[i], "%15[^=]=%d%n", name, &number, &n) > 0 && n > 0) {
-            shash_add(&port_names, name, (void *) number);
+            uintptr_t n = number;
+            shash_add(&port_names, name, (void *) n);
         } else {
             ovs_fatal(0, "%s: expected NAME=NUMBER", argv[i]);
         }
-- 
1.7.7.1




More information about the dev mailing list