diff options
author | Khem Raj <raj.khem@gmail.com> | 2022-04-24 09:57:56 -0700 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2022-04-25 10:44:14 -0700 |
commit | 1f56482ecf8cd90e795215253700ae99ffa5a22d (patch) | |
tree | 256921522e36c0f18ae383e5cd52dce961470ee1 | |
parent | 5f6156c0ef842bd39e9eb1f7ce02eb7c7c961d3a (diff) | |
download | meta-openembedded-1f56482ecf8cd90e795215253700ae99ffa5a22d.tar.gz |
netdata: Fix build errors with clang
Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r-- | meta-webserver/recipes-webadmin/netdata/netdata/0001-Use-explicit-typecast-to-enum-rrdset_flags.patch | 39 | ||||
-rw-r--r-- | meta-webserver/recipes-webadmin/netdata/netdata_1.34.1.bb | 4 |
2 files changed, 42 insertions, 1 deletions
diff --git a/meta-webserver/recipes-webadmin/netdata/netdata/0001-Use-explicit-typecast-to-enum-rrdset_flags.patch b/meta-webserver/recipes-webadmin/netdata/netdata/0001-Use-explicit-typecast-to-enum-rrdset_flags.patch new file mode 100644 index 0000000000..e3c7a7cd2b --- /dev/null +++ b/meta-webserver/recipes-webadmin/netdata/netdata/0001-Use-explicit-typecast-to-enum-rrdset_flags.patch | |||
@@ -0,0 +1,39 @@ | |||
1 | From e8ec0a0f3a353a8167687a8fdb26773e45927aac Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Sun, 24 Apr 2022 09:49:12 -0700 | ||
4 | Subject: [PATCH] Use explicit typecast to enum rrdset_flags | ||
5 | |||
6 | specifications say | ||
7 | An enumerator can be promoted to an integer value. However, | ||
8 | converting an integer to an enumerator requires an explicit | ||
9 | cast, and the results are not defined. | ||
10 | |||
11 | Therefore The bitwise OR operation you are performing results | ||
12 | in an int, which you then attempt to assign to a variable of | ||
13 | type rrdset_flags without a cast. | ||
14 | |||
15 | Fixes | ||
16 | | ml/Host.cc:167:9: error: assigning to 'RRDSET_FLAGS' (aka 'rrdset_flags') from incompatible type 'int' | ||
17 | | rrdset_flag_set(RS, RRDSET_FLAG_ANOMALY_DETECTION); | ||
18 | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
19 | |||
20 | Upstream-Status: Submitted [https://github.com/netdata/netdata/pull/12750] | ||
21 | |||
22 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
23 | --- | ||
24 | database/rrd.h | 4 ++-- | ||
25 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
26 | |||
27 | --- a/database/rrd.h | ||
28 | +++ b/database/rrd.h | ||
29 | @@ -489,8 +489,8 @@ typedef enum rrdset_flags { | ||
30 | #define rrdset_flag_clear(st, flag) __atomic_and_fetch(&((st)->flags), ~flag, __ATOMIC_SEQ_CST) | ||
31 | #else | ||
32 | #define rrdset_flag_check(st, flag) ((st)->flags & (flag)) | ||
33 | -#define rrdset_flag_set(st, flag) (st)->flags |= (flag) | ||
34 | -#define rrdset_flag_clear(st, flag) (st)->flags &= ~(flag) | ||
35 | +#define rrdset_flag_set(st, flag) (st)->flags = (RRDSET_FLAGS)((st)->flags | flag) | ||
36 | +#define rrdset_flag_clear(st, flag) (st)->flags = (RRDSET_FLAGS)((st)->flags & ~(flag)) | ||
37 | #endif | ||
38 | #define rrdset_flag_check_noatomic(st, flag) ((st)->flags & (flag)) | ||
39 | |||
diff --git a/meta-webserver/recipes-webadmin/netdata/netdata_1.34.1.bb b/meta-webserver/recipes-webadmin/netdata/netdata_1.34.1.bb index 71fb0783b6..b777d20897 100644 --- a/meta-webserver/recipes-webadmin/netdata/netdata_1.34.1.bb +++ b/meta-webserver/recipes-webadmin/netdata/netdata_1.34.1.bb | |||
@@ -7,7 +7,9 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=fc9b848046ef54b5eaee6071947abd24" | |||
7 | 7 | ||
8 | DEPENDS += "libuv util-linux zlib" | 8 | DEPENDS += "libuv util-linux zlib" |
9 | 9 | ||
10 | SRC_URI = "https://github.com/${BPN}/${BPN}/releases/download/v${PV}/${BPN}-v${PV}.tar.gz" | 10 | SRC_URI = "https://github.com/${BPN}/${BPN}/releases/download/v${PV}/${BPN}-v${PV}.tar.gz \ |
11 | file://0001-Use-explicit-typecast-to-enum-rrdset_flags.patch \ | ||
12 | " | ||
11 | SRC_URI[sha256sum] = "8ea0786df0e952209c14efeb02e25339a0769aa3edc029e12816b8ead24a82d7" | 13 | SRC_URI[sha256sum] = "8ea0786df0e952209c14efeb02e25339a0769aa3edc029e12816b8ead24a82d7" |
12 | 14 | ||
13 | # default netdata.conf for netdata configuration | 15 | # default netdata.conf for netdata configuration |