summaryrefslogtreecommitdiff
path: root/lib/ccan/cast/test/compile_fail-cast_static.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ccan/cast/test/compile_fail-cast_static.c')
-rw-r--r--lib/ccan/cast/test/compile_fail-cast_static.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/ccan/cast/test/compile_fail-cast_static.c b/lib/ccan/cast/test/compile_fail-cast_static.c
new file mode 100644
index 0000000000..0f9e478047
--- /dev/null
+++ b/lib/ccan/cast/test/compile_fail-cast_static.c
@@ -0,0 +1,17 @@
+#include <ccan/cast/cast.h>
+#include <stdlib.h>
+
+int main(int argc, char *argv[])
+{
+ char c;
+#ifdef FAIL
+ char *
+#else
+ long
+#endif
+ x = 0;
+
+ c = cast_static(char, x);
+ (void) c; /* Suppress unused-but-set-variable warning. */
+ return 0;
+}