]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Suppress a clang 12 warning about "suspicious concatenation".
authorNick Mathewson <nickm@torproject.org>
Thu, 1 Jul 2021 17:03:19 +0000 (13:03 -0400)
committerNick Mathewson <nickm@torproject.org>
Thu, 1 Jul 2021 17:03:19 +0000 (13:03 -0400)
My clang doesn't like it when we write code like this:

    char *list[] = {
       "abc",
       "def",
       "ghi"
       "jkl"
    }

It wonders whether we meant to put a comma between "ghi" and "jkl"
or not, and gives a warning.

To suppress this warning (since in this case, we did mean to omit
the comma), we just wrap the two strings in parentheses.

Closes #40426; bugfix on 0.4.0.4-rc.

src/test/test_dir.c

index d62dd3fb9ec855bbcd1efde52ce5612a72aa96f5..467b740d71ce2ec301b21e7d36d5b6466b30dfb8 100644 (file)
@@ -2135,8 +2135,8 @@ test_dir_measured_bw_kb(void *arg)
     /* Test that a line with vote=0 will fail too, so that it is ignored. */
     "node_id=$557365204145532d32353620696e73746561642e bw=1024 vote=0\n",
     /* Test that a line with vote=0 will fail even if unmeasured=0. */
-    "node_id=$557365204145532d32353620696e73746561642e bw=1024 vote=0 "
-    "unmeasured=0\n",
+    ("node_id=$557365204145532d32353620696e73746561642e bw=1024 vote=0 "
+     "unmeasured=0\n"),
     "end"
   };