summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrantisek Sumsal <frantisek@sumsal.cz>2021-02-08 11:26:26 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-03-12 18:24:04 +0100
commit28fa0e508a0fa544c47d18f1f17213bf7da6b4c7 (patch)
tree00ab41de5fccc2433b669db0caaa3e2fff3ef0e0
parent3544c965ae261d468838806d51e423b04f162b4f (diff)
downloadsystemd-28fa0e508a0fa544c47d18f1f17213bf7da6b4c7.tar.gz
tree-wide: fix the string concatenation warning with clang-12
e.g.: ./src/shared/dissect-image.c:2218:39: error: suspicious concatenation of string literals in an array initialization; did you mean to separate the elements with a comma? [-Werror,-Wstring-concatenation] "/usr/lib/os-release\0", ^ ../src/shared/dissect-image.c:2217:39: note: place parentheses around the string literal to silence warning [META_OS_RELEASE] = "/etc/os-release\0" ^ 1 error generated. See: https://reviews.llvm.org/D85545 (cherry picked from commit 8762049792024df1be9f0b219438220bb9ee547d) (cherry picked from commit 6345ef607976ce0311d01a38ee30855f5416ff1f)
-rw-r--r--src/shared/dissect-image.c4
-rw-r--r--src/test/test-xdg-autostart.c18
2 files changed, 11 insertions, 11 deletions
diff --git a/src/shared/dissect-image.c b/src/shared/dissect-image.c
index 01fcacb2ad..36f65ed4cb 100644
--- a/src/shared/dissect-image.c
+++ b/src/shared/dissect-image.c
@@ -1678,8 +1678,8 @@ int dissected_image_acquire_metadata(DissectedImage *m) {
[META_HOSTNAME] = "/etc/hostname\0",
[META_MACHINE_ID] = "/etc/machine-id\0",
[META_MACHINE_INFO] = "/etc/machine-info\0",
- [META_OS_RELEASE] = "/etc/os-release\0"
- "/usr/lib/os-release\0",
+ [META_OS_RELEASE] = ("/etc/os-release\0"
+ "/usr/lib/os-release\0"),
};
_cleanup_strv_free_ char **machine_info = NULL, **os_release = NULL;
diff --git a/src/test/test-xdg-autostart.c b/src/test/test-xdg-autostart.c
index 70287b3c55..68d6e0005a 100644
--- a/src/test/test-xdg-autostart.c
+++ b/src/test/test-xdg-autostart.c
@@ -37,17 +37,17 @@ static void test_xdg_format_exec_start(void) {
}
static const char* const xdg_desktop_file[] = {
- "[Desktop Entry]\n"
- "Exec\t =\t /bin/sleep 100\n" /* Whitespace Before/After = must be ignored */
- "OnlyShowIn = A;B;\n"
- "NotShowIn=C;;D\\\\\\;;E\n", /* "C", "", "D\;", "E" */
+ ("[Desktop Entry]\n"
+ "Exec\t =\t /bin/sleep 100\n" /* Whitespace Before/After = must be ignored */
+ "OnlyShowIn = A;B;\n"
+ "NotShowIn=C;;D\\\\\\;;E\n"), /* "C", "", "D\;", "E" */
- "[Desktop Entry]\n"
- "Exec=a\n"
- "Exec=b\n",
+ ("[Desktop Entry]\n"
+ "Exec=a\n"
+ "Exec=b\n"),
- "[Desktop Entry]\n"
- "Hidden=\t true\n",
+ ("[Desktop Entry]\n"
+ "Hidden=\t true\n"),
};
static void test_xdg_desktop_parse(unsigned i, const char *s) {