diff options
author | Khem Raj <raj.khem@gmail.com> | 2017-08-26 11:35:15 -0700 |
---|---|---|
committer | Joe MacDonald <joe_macdonald@mentor.com> | 2017-09-12 10:55:06 -0400 |
commit | cc19bced6af85818bb2dbcd4d30e335b874b43cf (patch) | |
tree | 8ddfafe46f277615a4b7ae8a80622a3286cce719 /meta-networking | |
parent | 54684b2b17777cc18d08a1f7de367e0fbc2a068b (diff) | |
download | meta-openembedded-cc19bced6af85818bb2dbcd4d30e335b874b43cf.tar.gz |
ippool: Fix build errors found by clang
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
Diffstat (limited to 'meta-networking')
4 files changed, 124 insertions, 1 deletions
diff --git a/meta-networking/recipes-daemons/ippool/ippool/0001-read-returns-ssize_t.patch b/meta-networking/recipes-daemons/ippool/ippool/0001-read-returns-ssize_t.patch new file mode 100644 index 000000000..7d3f9acb6 --- /dev/null +++ b/meta-networking/recipes-daemons/ippool/ippool/0001-read-returns-ssize_t.patch | |||
@@ -0,0 +1,31 @@ | |||
1 | From e4e0aae139b6489dc582fd14e54e562126482ce2 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Sat, 26 Aug 2017 07:23:53 -0700 | ||
4 | Subject: [PATCH 1/3] read() returns ssize_t | ||
5 | |||
6 | Fixes | ||
7 | usl_fd.c:284:10: error: comparison of unsigned expression < 0 is always false [-Werror,-Wtautological-compare] | ||
8 | if (nb < 0) { | ||
9 | ~~ ^ ~ | ||
10 | |||
11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
12 | --- | ||
13 | usl/usl_fd.c | 2 +- | ||
14 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
15 | |||
16 | diff --git a/usl/usl_fd.c b/usl/usl_fd.c | ||
17 | index 3b7a813..04ba48c 100644 | ||
18 | --- a/usl/usl_fd.c | ||
19 | +++ b/usl/usl_fd.c | ||
20 | @@ -280,7 +280,7 @@ size_t usl_fd_read(int fd, void *buf, size_t count) | ||
21 | char *ptr = buf; | ||
22 | |||
23 | for (chars_read = 0; chars_read < count; ) { | ||
24 | - size_t nb = read(fd, ptr, count - chars_read); | ||
25 | + ssize_t nb = read(fd, ptr, count - chars_read); | ||
26 | if (nb < 0) { | ||
27 | if (errno == EINTR) | ||
28 | continue; | ||
29 | -- | ||
30 | 2.14.1 | ||
31 | |||
diff --git a/meta-networking/recipes-daemons/ippool/ippool/0002-Mark-first-element-of-a-string-as-null.patch b/meta-networking/recipes-daemons/ippool/ippool/0002-Mark-first-element-of-a-string-as-null.patch new file mode 100644 index 000000000..6e2bd523d --- /dev/null +++ b/meta-networking/recipes-daemons/ippool/ippool/0002-Mark-first-element-of-a-string-as-null.patch | |||
@@ -0,0 +1,31 @@ | |||
1 | From cf25576428903168cd41b183fb1ca9c2b7e2666e Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Sat, 26 Aug 2017 07:28:10 -0700 | ||
4 | Subject: [PATCH 2/3] Mark first element of a string as null | ||
5 | |||
6 | Fixes | ||
7 | cli_lib.c:427:20: error: expression which evaluates to zero treated as a null pointer constant of type 'char *' [-Werror,-Wnon-literal-null-conversion] | ||
8 | values[arg] = '\0'; | ||
9 | ^~~~ | ||
10 | |||
11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
12 | --- | ||
13 | cli/cli_lib.c | 2 +- | ||
14 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
15 | |||
16 | diff --git a/cli/cli_lib.c b/cli/cli_lib.c | ||
17 | index 41a0b06..e4d2fd5 100644 | ||
18 | --- a/cli/cli_lib.c | ||
19 | +++ b/cli/cli_lib.c | ||
20 | @@ -424,7 +424,7 @@ int cli_find_args(int argc, char *argv[], struct cli_node *cmd, struct cli_node | ||
21 | if (arg_string[1] == '\0') { | ||
22 | /* no arg value - only allowed for string args */ | ||
23 | if (node->arg->parser == cli_arg_parse_string) { | ||
24 | - values[arg] = '\0'; | ||
25 | + *values[arg] = '\0'; | ||
26 | } else { | ||
27 | result = -EINVAL; | ||
28 | break; | ||
29 | -- | ||
30 | 2.14.1 | ||
31 | |||
diff --git a/meta-networking/recipes-daemons/ippool/ippool/0003-cli-Mark-return-of-strtol-as-long-int.patch b/meta-networking/recipes-daemons/ippool/ippool/0003-cli-Mark-return-of-strtol-as-long-int.patch new file mode 100644 index 000000000..3854b1133 --- /dev/null +++ b/meta-networking/recipes-daemons/ippool/ippool/0003-cli-Mark-return-of-strtol-as-long-int.patch | |||
@@ -0,0 +1,58 @@ | |||
1 | From 994d9575374d3cdb34b1b0f70c3c53ae76fe578e Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Sat, 26 Aug 2017 07:41:05 -0700 | ||
4 | Subject: [PATCH 3/3] cli: Mark return of strtol as long int | ||
5 | |||
6 | strtol does not return unsigned long | ||
7 | |||
8 | error: taking the absolute value of unsigned type 'unsigned long' has no effect [-Werror,-Wabsolute-value] | ||
9 | if ((*endp == '\0') && (labs(tmp) < 32768)) { | ||
10 | |||
11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
12 | --- | ||
13 | cli/cli_lib.c | 8 ++++---- | ||
14 | 1 file changed, 4 insertions(+), 4 deletions(-) | ||
15 | |||
16 | diff --git a/cli/cli_lib.c b/cli/cli_lib.c | ||
17 | index e4d2fd5..5f487dc 100644 | ||
18 | --- a/cli/cli_lib.c | ||
19 | +++ b/cli/cli_lib.c | ||
20 | @@ -522,7 +522,7 @@ int cli_arg_parse_int32(struct cli_node *arg, const char *val, void *result) | ||
21 | int cli_arg_parse_int16(struct cli_node *arg, const char *val, void *result) | ||
22 | { | ||
23 | int16_t *intval = result; | ||
24 | - unsigned long tmp; | ||
25 | + long tmp; | ||
26 | char *endp; | ||
27 | int ret = 0; | ||
28 | |||
29 | @@ -539,7 +539,7 @@ int cli_arg_parse_int16(struct cli_node *arg, const char *val, void *result) | ||
30 | int cli_arg_parse_int8(struct cli_node *arg, const char *val, void *result) | ||
31 | { | ||
32 | int8_t *intval = result; | ||
33 | - unsigned long tmp; | ||
34 | + long tmp; | ||
35 | char *endp; | ||
36 | int ret = 0; | ||
37 | |||
38 | @@ -573,7 +573,7 @@ int cli_arg_parse_uint32(struct cli_node *arg, const char *val, void *result) | ||
39 | int cli_arg_parse_uint16(struct cli_node *arg, const char *val, void *result) | ||
40 | { | ||
41 | uint16_t *intval = result; | ||
42 | - unsigned long tmp; | ||
43 | + long tmp; | ||
44 | char *endp; | ||
45 | int ret = 0; | ||
46 | |||
47 | @@ -590,7 +590,7 @@ int cli_arg_parse_uint16(struct cli_node *arg, const char *val, void *result) | ||
48 | int cli_arg_parse_uint8(struct cli_node *arg, const char *val, void *result) | ||
49 | { | ||
50 | uint8_t *intval = result; | ||
51 | - unsigned long tmp; | ||
52 | + long tmp; | ||
53 | char *endp; | ||
54 | int ret = 0; | ||
55 | |||
56 | -- | ||
57 | 2.14.1 | ||
58 | |||
diff --git a/meta-networking/recipes-daemons/ippool/ippool_1.3.bb b/meta-networking/recipes-daemons/ippool/ippool_1.3.bb index 05921d536..6e4748357 100644 --- a/meta-networking/recipes-daemons/ippool/ippool_1.3.bb +++ b/meta-networking/recipes-daemons/ippool/ippool_1.3.bb | |||
@@ -21,7 +21,10 @@ SRC_URI = "https://sourceforge.net/projects/openl2tp/files/${BPN}/${PV}/${BPN}-$ | |||
21 | file://makefile-add-ldflags.patch \ | 21 | file://makefile-add-ldflags.patch \ |
22 | file://0001-usl_timer-Check-for-return-value-of-write-API.patch \ | 22 | file://0001-usl_timer-Check-for-return-value-of-write-API.patch \ |
23 | file://0001-Respect-flags-from-env.patch \ | 23 | file://0001-Respect-flags-from-env.patch \ |
24 | " | 24 | file://0001-read-returns-ssize_t.patch \ |
25 | file://0002-Mark-first-element-of-a-string-as-null.patch \ | ||
26 | file://0003-cli-Mark-return-of-strtol-as-long-int.patch \ | ||
27 | " | ||
25 | SRC_URI_append_libc-musl = "\ | 28 | SRC_URI_append_libc-musl = "\ |
26 | file://0002-link-with-libtirpc.patch \ | 29 | file://0002-link-with-libtirpc.patch \ |
27 | file://0003-musl-fixes.patch \ | 30 | file://0003-musl-fixes.patch \ |