]> git.ozlabs.org Git - ccan/blobdiff - ccan/typesafe_cb/test/compile_ok-typesafe_cb-volatile.c
typesafe: fix warnings with gcc's -Wcast-qual
[ccan] / ccan / typesafe_cb / test / compile_ok-typesafe_cb-volatile.c
index 93875c9e5d784dcb490227d7ae49f2f3e676d11c..3fcb1ff656b3b576b887a74c63577b2fbca84247 100644 (file)
@@ -1,4 +1,4 @@
-#include "typesafe_cb/typesafe_cb.h"
+#include <ccan/typesafe_cb/typesafe_cb.h>
 #include <stdlib.h>
 
 /* volatile args in callbacks should be OK. */
 #include <stdlib.h>
 
 /* volatile args in callbacks should be OK. */
@@ -28,18 +28,20 @@ static void my_callback(volatile char *p)
 {
 }
 
 {
 }
 
-static void my_callback_pre(int x, volatile char *p)
+/* FIXME: Can't handle volatile for these */
+static void my_callback_pre(int x, /* volatile */ char *p)
 {
 }
 
 {
 }
 
-static void my_callback_post(volatile char *p, int x)
+static void my_callback_post(/* volatile */ char *p, int x)
 {
 }
 
 int main(int argc, char *argv[])
 {
 {
 }
 
 int main(int argc, char *argv[])
 {
-       register_callback(my_callback, "hello world");
-       register_callback_pre(my_callback_pre, "hello world");
-       register_callback_post(my_callback_post, "hello world");
+       char p[] = "hello world";
+       register_callback(my_callback, p);
+       register_callback_pre(my_callback_pre, p);
+       register_callback_post(my_callback_post, p);
        return 0;
 }
        return 0;
 }