]> git.ozlabs.org Git - ccan/commitdiff
typesafe_cb: 64 bit fixes.
authorRusty Russell <rusty@rustcorp.com.au>
Wed, 20 Oct 2010 02:28:49 +0000 (12:58 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Wed, 20 Oct 2010 02:28:49 +0000 (12:58 +1030)
In particular, gcc warns about cast from int to pointer.

ccan/typesafe_cb/test/compile_fail-cast_if_type-promotable.c

index a0362485c54320e534002c92273199514bc07aa4..016d0e2a4f00da90d3b9f9da1fe1f4a6eb3137ec 100644 (file)
@@ -6,7 +6,7 @@ static void _set_some_value(void *val)
 }
 
 #define set_some_value(expr)                                           \
-       _set_some_value(cast_if_type(void *, (expr), (expr), int))
+       _set_some_value(cast_if_type(void *, (expr), (expr), long))
 
 int main(int argc, char *argv[])
 {
@@ -16,7 +16,7 @@ int main(int argc, char *argv[])
 #error "Unfortunately we don't fail if cast_if_type is a noop."
 #endif
 #else
-       int x = 0;
+       long x = 0;
 #endif
        set_some_value(x);
        return 0;