Andrei G uploaded patch set #2 to this change.

View Change

core/hash: avoid __always_inline in public header

include/osmocom/core/hash.h declares hash_64_generic() with
__always_inline. That spelling was imported with the file from the Linux
kernel. glibc defines the macro in <sys/cdefs.h>, so it happens to work
there. Darwin, FreeBSD and OpenBSD do not define it, and every consumer of
hash.h fails to compile with clang: "unknown type name '__always_inline'",
followed by "call to undeclared function 'hash_64_generic'" further down.

Use the spelling the neighbouring public header already uses:
include/osmocom/core/log2.h declares fls() and fls64() as

static inline __attribute__((always_inline))

The #ifndef __always_inline guard used in src/core/conv_acc_sse_impl.h and
conv_acc_neon_impl.h is the other in-tree option, but those are private
sources; a public header should not define a reserved identifier for its
includers.

hash.h stayed unnoticed because libosmo-sigtran is the first consumer to
include hashtable.h. Reproduced on macOS ARM64 with clang 17 (Xcode 16).
The same failure is expected on FreeBSD and OpenBSD with base clang.

Change-Id: I103831bacde6d2f3f2a140812cd1e2300298bab5
Signed-off-by: Andrei Gosman <andrei.gosman@gmail.com>
---
M include/osmocom/core/hash.h
1 file changed, 1 insertion(+), 1 deletion(-)

git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/71/43571/2

To view, visit change 43571. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newpatchset
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I103831bacde6d2f3f2a140812cd1e2300298bab5
Gerrit-Change-Number: 43571
Gerrit-PatchSet: 2
Gerrit-Owner: Andrei G <andrei.gosman@gmail.com>
Gerrit-CC: Jenkins Builder