From 088030222124fc906364f30dcdc945191ecd61e7 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Tue, 18 Aug 2015 16:17:02 -0700 Subject: [PATCH] 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 --- ccan/bytestring/test/compile_fail-BYTESTRING-2.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ccan/bytestring/test/compile_fail-BYTESTRING-2.c b/ccan/bytestring/test/compile_fail-BYTESTRING-2.c index 87dd7c7d..d4a610e2 100644 --- a/ccan/bytestring/test/compile_fail-BYTESTRING-2.c +++ b/ccan/bytestring/test/compile_fail-BYTESTRING-2.c @@ -4,6 +4,12 @@ #include +/* + * 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; -- 2.39.2