Apparently clang doesn't like 64-bit enum values now:
/usr/local/include/basu/sd-bus.h:88:9: error: ISO C restricts enumerator values to range of 'int' (2147483648 is too large) [-Werror,-Wpedantic]
SD_BUS_CREDS_UNIQUE_NAME = 1ULL << 31,
^ ~~~~~~~~~~
/usr/local/include/basu/sd-bus.h:89:9: error: ISO C restricts enumerator values to range of 'int' (4294967296 is too large) [-Werror,-Wpedantic]
SD_BUS_CREDS_WELL_KNOWN_NAMES = 1ULL << 32,
^ ~~~~~~~~~~
…
and in another file
/usr/local/include/basu/sd-bus-vtable.h:46:9: error: ISO C restricts enumerator values to range of 'int' (72056494526300160 is too large) [-Werror,-Wpedantic]
_SD_BUS_VTABLE_CAPABILITY_MASK = 0xFFFFULL << 40
^ ~~~~~~~~~~~~~~~
Hmm, this is part of the API. I think we're stuck with an enum. We could try to remove values and compress it to fit in a 32-bit range, but that's not great either...
Has upstream systemd done something about this?
Their enum is identical in master: https://github.com/systemd/systemd/blob/6c41cf445912c12e14b1e94414a0fce1fa060ac2/src/systemd/sd-bus.h#L58
I don't think they build with
-Wpedantic
though. Neither do we for that matter.
I guess one "solution" would be
#pramga GCC diagnostic ignored "-Wpedantic"
..
I'd rather not add pragma directives.
I guess one "solution" would be
#pramga GCC diagnostic ignored "-Wpedantic"
..Seems easier to build without
-Wpedantic
than to add compiler-specific hacks to the source to mute it. :/
Well, yeah, but unfortunately some projects that include
sd-bus.h
usewarning_level=3
werror=true
by default ;) (though yeah that would affect actual systemd/elogind as well if someone used clang12, so not really a basu specific problem then)
The headers installed system-wide should be marked a "system includes" with
-isystem
by Meson, and warnings in these should get silenced automatically.Unfortunately on FreeBSD Meson doesn't do it for
/usr/local
.