Browse Source

bytestring: Add rational comment to testcase

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>
David Gibson 10 years ago
parent
commit
0880302221
1 changed files with 6 additions and 0 deletions
  1. 6 0
      ccan/bytestring/test/compile_fail-BYTESTRING-2.c

+ 6 - 0
ccan/bytestring/test/compile_fail-BYTESTRING-2.c

@@ -4,6 +4,12 @@
 
 
 #include <ccan/bytestring/bytestring.h>
 #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[])
 int main(int argc, char *argv[])
 {
 {
 	struct bytestring bs;
 	struct bytestring bs;