ANDROID: uapi: icmp: Bionic compat with __unused

Building CONFIG_UAPI_HEADER_TEST=y with a Bionic (Android's libc) based
sysroot produces the following warning:

In file included from <built-in>:1:
./usr/include/linux/icmp.h:100:3: warning: declaration does not declare
anything [-Wmissing-declarations]
__be16  __unused;
^~~~~~

This is because Bionic defines __unused to expand to
__attribute__((__unused__)). Bionic pre-processes kernel headers and
redefines __unused to __linux_unused.

Do so here to avoid issues that only appear for Bionic based sysroot
UAPI header tests.

Link: 4ebdeebef7/libc/include/sys/cdefs.h (95)
Link: 4ebdeebef7/libc/kernel/tools/defaults.py (70)
Bug: 190019968
Bug: 234125788
Reported-by: Matthias Männich<maennich@google.com>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Change-Id: I2341953cbfce8e28b982c34df2df4b3b364d63a6
This commit is contained in:
Nick Desaulniers
2022-05-31 14:52:00 -07:00
committed by Carlos Llamas
parent 188e6f57c8
commit 88bfecd11c

View File

@@ -97,7 +97,11 @@ struct icmphdr {
} echo;
__be32 gateway;
struct {
#ifdef __BIONIC__
__be16 __linux_unused;
#else
__be16 __unused;
#endif
__be16 mtu;
} frag;
__u8 reserved[4];