]> git.ozlabs.org Git - ccan/blobdiff - ccan/str/test/compile_ok-STR_MAX_CHARS-static.c
str: make sure STR_MAX_CHARS gives a constant expression.
[ccan] / ccan / str / test / compile_ok-STR_MAX_CHARS-static.c
diff --git a/ccan/str/test/compile_ok-STR_MAX_CHARS-static.c b/ccan/str/test/compile_ok-STR_MAX_CHARS-static.c
new file mode 100644 (file)
index 0000000..bc6aff7
--- /dev/null
@@ -0,0 +1,8 @@
+#include <ccan/str/str.h>
+
+int main(void)
+{
+       static char str[STR_MAX_CHARS(int)];
+
+       return str[0] ? 0 : 1;
+}