Skip to content

Commit 3a4e0b3

Browse files
rgetzpcercuei
authored andcommitted
tests: fix warning about suspicious concatenation of string literals
With clang (MacOS 11) We were getting: error: suspicious concatenation of string literals in an array initialization; note: place parentheses around the string literal to silence warning So, do so. Signed-off-by: Robin Getz <[email protected]>
1 parent ad19115 commit 3a4e0b3

File tree

6 files changed

+20
-20
lines changed

6 files changed

+20
-20
lines changed

tests/iio_attr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,11 +321,11 @@ static const struct option options[] = {
321321
};
322322

323323
static const char *options_descriptions[] = {
324-
"-d [device] [attr] [value]\n"
324+
("-d [device] [attr] [value]\n"
325325
"\t\t\t\t-c [device] [channel] [attr] [value]\n"
326326
"\t\t\t\t-B [device] [attr] [value]\n"
327327
"\t\t\t\t-D [device] [attr] [value]\n"
328-
"\t\t\t\t-C [attr]",
328+
"\t\t\t\t-C [attr]"),
329329
/* help */
330330
"Ignore case distinctions.",
331331
"Return result only.",

tests/iio_common.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -238,19 +238,19 @@ struct option * add_common_options(const struct option * longopts)
238238
static const char *common_options_descriptions[] = {
239239
"Show this help and quit.",
240240
"Use the XML backend with the provided XML file.",
241-
"Use the context at the provided URI."
241+
("Use the context at the provided URI."
242242
"\n\t\t\teg: 'ip:192.168.2.1', 'ip:pluto.local', or 'ip:'"
243243
"\n\t\t\t 'usb:1.2.3', or 'usb:'"
244244
"\n\t\t\t 'serial:/dev/ttyUSB0,115200,8n1'"
245-
"\n\t\t\t 'local:' (Linux only)",
246-
"Scan for available backends."
245+
"\n\t\t\t 'local:' (Linux only)"),
246+
("Scan for available backends."
247247
"\n\t\t\toptional arg of specific backend(s)"
248-
"\n\t\t\t 'ip', 'usb' or 'ip:usb'",
249-
"Scan for available contexts and if a single context is"
248+
"\n\t\t\t 'ip', 'usb' or 'ip:usb'"),
249+
("Scan for available contexts and if a single context is"
250250
"\n\t\t\tavailable use it. <arg> filters backend(s)"
251-
"\n\t\t\t 'ip', 'usb' or 'ip:usb:'",
252-
"Context timeout in milliseconds."
253-
"\n\t\t\t0 = no timeout (wait forever)",
251+
"\n\t\t\t 'ip', 'usb' or 'ip:usb:'"),
252+
("Context timeout in milliseconds."
253+
"\n\t\t\t0 = no timeout (wait forever)"),
254254
};
255255

256256

tests/iio_genxml.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ static const struct option options[] = {
3333
};
3434

3535
static const char *options_descriptions[] = {
36-
"\t[-x <xml_file>]\n"
36+
("\t[-x <xml_file>]\n"
3737
"\t\t\t\t[-u <uri>]\n"
38-
"\t\t\t\t[-n <hostname>]",
38+
"\t\t\t\t[-n <hostname>]"),
3939
};
4040

4141
int main(int argc, char **argv)

tests/iio_info.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ static const struct option options[] = {
3939
};
4040

4141
static const char *options_descriptions[] = {
42-
"[-x <xml_file>]\n"
43-
"\t\t\t\t[-u <uri>]",
42+
("[-x <xml_file>]\n"
43+
"\t\t\t\t[-u <uri>]"),
4444
};
4545

4646
static int dev_is_buffer_capable(const struct iio_device *dev)

tests/iio_stresstest.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ static const struct option options[] = {
107107
};
108108

109109
static const char *options_descriptions[] = {
110-
"[-n <hostname>] [-u <vid>:<pid>] [-t <trigger>] [-b <buffer-size>] [-s <samples>]"
111-
"<iio_device> [<channel> ...]",
110+
("[-n <hostname>] [-u <vid>:<pid>] [-t <trigger>] [-b <buffer-size>] [-s <samples>]"
111+
"<iio_device> [<channel> ...]"),
112112
"Show this help and quit.",
113113
"Use the context at the provided URI.",
114114
"Size of the capture buffer. Default is 256.",

tests/iio_writedev.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,16 @@ static const struct option options[] = {
5656
};
5757

5858
static const char *options_descriptions[] = {
59-
"[-t <trigger>] "
59+
("[-t <trigger>] "
6060
"[-b <buffer-size>] [-s <samples>] "
61-
"<iio_device> [<channel> ...]",
61+
"<iio_device> [<channel> ...]"),
6262
"Use the specified trigger.",
6363
"Size of the transmit buffer. Default is 256.",
6464
"Number of samples to write, 0 = infinite. Default is 0.",
6565
"Scan for available contexts and if only one is available use it.",
6666
"Use cyclic buffer mode.",
67-
"Benchmark throughput."
68-
"\n\t\t\tStatistics will be printed on the standard input.",
67+
("Benchmark throughput."
68+
"\n\t\t\tStatistics will be printed on the standard input."),
6969
};
7070

7171
static struct iio_context *ctx;

0 commit comments

Comments
 (0)