Make tokenizer throw error on empty char literal, along with some slight cleanups...
[ccan] / ccan / typesafe_cb / test / compile_fail-cast_if_type.c
1 #include "typesafe_cb/typesafe_cb.h"
2
3 void _set_some_value(void *val);
4
5 void _set_some_value(void *val)
6 {
7 }
8
9 #define set_some_value(expr)                                            \
10         _set_some_value(cast_if_type((expr), unsigned long, void *))
11
12 int main(int argc, char *argv[])
13 {
14 #ifdef FAIL
15         int x = 0;
16         set_some_value(x);
17 #if !HAVE_TYPEOF||!HAVE_BUILTIN_CHOOSE_EXPR||!HAVE_BUILTIN_TYPES_COMPATIBLE_P
18 #error "Unfortunately we don't fail if cast_if_type is a noop."
19 #endif
20 #else
21         void *p = 0;
22         set_some_value(p);
23 #endif
24         return 0;
25 }