summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/ccan/cast/test/compile_fail-cast_static.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/ccan/cast/test/compile_fail-cast_static.c b/lib/ccan/cast/test/compile_fail-cast_static.c
index 0f9e478047..a4ebf61b1a 100644
--- a/lib/ccan/cast/test/compile_fail-cast_static.c
+++ b/lib/ccan/cast/test/compile_fail-cast_static.c
@@ -3,15 +3,21 @@
int main(int argc, char *argv[])
{
- char c;
+ long c;
#ifdef FAIL
char *
#else
- long
+ char
#endif
x = 0;
- c = cast_static(char, x);
+ c = cast_static(long, x);
(void) c; /* Suppress unused-but-set-variable warning. */
return 0;
}
+
+#ifdef FAIL
+#if !HAVE_COMPOUND_LITERALS
+#error "Unfortunately we don't fail if cast_static without compound literals"
+#endif
+#endif