diff mbox series

[1/2] app/test: fix clang 12 warning

Message ID 20210420130915.166692-1-ktraynor@redhat.com (mailing list archive)
State Superseded
Headers show
Series [1/2] app/test: fix clang 12 warning | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Kevin Traynor April 20, 2021, 1:09 p.m. UTC
clang 12 gives a warning about string size. In this case it looks like
it was unintentional to concatenate the strings. Separate with a comma.

$ clang --version
clang version 12.0.0 (Fedora 12.0.0-0.3.rc1.fc34)

[2557/2719]
Compiling C object app/test/dpdk-test.p/test_cmdline_ipaddr.c.o
../app/test/test_cmdline_ipaddr.c:259:3: warning:
suspicious concatenation of string literals in an array initialization;
did you mean to separate the elements with a comma?
[-Wstring-concatenation]
"random invalid text",
^
../app/test/test_cmdline_ipaddr.c:258:3: note:
place parentheses around the string literal to silence warning
"1234:1234:1234:1234:1234:1234:1234:1234:1234:1234:1234"
^

Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
---
 app/test/test_cmdline_ipaddr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/app/test/test_cmdline_ipaddr.c b/app/test/test_cmdline_ipaddr.c
index b3f50d80d2..2a1ee120fc 100644
--- a/app/test/test_cmdline_ipaddr.c
+++ b/app/test/test_cmdline_ipaddr.c
@@ -256,5 +256,5 @@  const char * ipaddr_invalid_strs[] = {
 
 		/* too long */
-		"1234:1234:1234:1234:1234:1234:1234:1234:1234:1234:1234"
+		"1234:1234:1234:1234:1234:1234:1234:1234:1234:1234:1234",
 		"random invalid text",
 		"",