From 754c677b0bbf3ea6c7d2a73c93848f1b0d68c91e Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 20 Jun 2011 16:54:15 +0930 Subject: lib: import ccan modules for tdb2 Imported from git://git.ozlabs.org/~ccan/ccan init-1161-g661d41f Signed-off-by: Rusty Russell --- lib/ccan/cast/test/compile_fail-cast_static-3.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 lib/ccan/cast/test/compile_fail-cast_static-3.c (limited to 'lib/ccan/cast/test/compile_fail-cast_static-3.c') diff --git a/lib/ccan/cast/test/compile_fail-cast_static-3.c b/lib/ccan/cast/test/compile_fail-cast_static-3.c new file mode 100644 index 0000000000..6296b75276 --- /dev/null +++ b/lib/ccan/cast/test/compile_fail-cast_static-3.c @@ -0,0 +1,21 @@ +#include +#include + +int main(int argc, char *argv[]) +{ + char *c; +#ifdef FAIL + const +#endif + char *p = 0; + + c = cast_static(char *, p); + (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 is a noop" +#endif +#endif -- cgit