On 12/29, Gix, Brian wrote:
In the BlueZ build, we apparently use stricter Warn to Error checking
than what is currently set up for ELL.
I got my son a new Raspberry PI, and the first thing he tried to build was ELL and
BlueZ... On THAT PATFORM
ONLY, Raspbian (Raspbian 10 (buster)) with kernel 4.19, we get failures building
ell/dbus.c. Everything builds
correctly in the ELL tree, using standard bootstrap-configure, however when using
-Werror=cast-align, I get the
following (see below) build issues in dbus.c, genl.c, dhcp-transport.c, plus a few unit
tests... In BlueZ
these errors show up with the *default* build procedure:
(...)
ell/util.h:40:3: error: cast increases required alignment of target
type [-Werror=cast-align]
(type *)((char *) __mptr - offsetof(type, member)); \
^
ell/dbus.c:582:3: note: in expansion of macro ‘l_container_of’
l_container_of(dbus, struct l_dbus_classic, super);
^~~~~~~~~~~~~~
FWIW, I've encountered that on iMX.6 as well. I've fixed that with:
diff --git a/ell/util.h b/ell/util.h
index 4f20ef0..fe7c7e2 100644
--- a/ell/util.h
+++ b/ell/util.h
@@ -37,7 +37,7 @@ extern "C" {
#define l_container_of(ptr, type, member) ({ \
const __typeof__(((type *) 0)->member) *__mptr = (ptr); \
- (type *)((char *) __mptr - offsetof(type, member)); \
+ (type *)(void *)((char *) __mptr - offsetof(type, member)); \
})
#define likely(x) __builtin_expect(!!(x), 1)
But I'm not sure this is correct...
regards
--
Michał Lowas-Rzechonek <michal.lowas-rzechonek(a)silvair.com>
Silvair
http://silvair.com
Jasnogórska 44, 31-358 Krakow, POLAND