]> git.ozlabs.org Git - ccan/commitdiff
bytestring: Add rational comment to testcase
authorDavid Gibson <david@gibson.dropbear.id.au>
Tue, 18 Aug 2015 23:17:02 +0000 (16:17 -0700)
committerDavid Gibson <david@gibson.dropbear.id.au>
Tue, 18 Aug 2015 23:17:57 +0000 (16:17 -0700)
Reviewing the previous patch it took me some time to work out what the
purpose of the compile_fail-BYTESTRING-2.c test.  Add a comment to avoid
that in future.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
ccan/bytestring/test/compile_fail-BYTESTRING-2.c

index 87dd7c7d2ed14bff965bbba30dd09248c2362ffc..d4a610e250e5bb0c0d3620e11fca944dac961a18 100644 (file)
@@ -4,6 +4,12 @@
 
 #include <ccan/bytestring/bytestring.h>
 
+/*
+ * BYTESTRING() can only be used safely on a literal string (or,
+ * strictly, something whose size can be determined with ARRAY_SIZE().
+ * This checks that it correctly fails to compile if used on a
+ * non-array pointer.
+ */
 int main(int argc, char *argv[])
 {
        struct bytestring bs;