Bug #4315
Android NDK cross compile error
Status:
Rejected
Priority:
Normal
Assignee:
-
Category:
General
Target version:
-
Start date:
2017-04-10
Due date:
% Done:
0%
Estimated time:
Found in version:
4.2
Affected Versions:
Description
I got this error when compile with android ndk
src/udp.c: In function 'udp_bind': src/udp.c:220:26: error: incompatible types when assigning to type '__be32' from type 'struct in_addr' ms.imr_multiaddr = IP_AS_V4(uc->ip, addr); ^ src/udp.c:224:9: error: passing argument 3 of 'udp_get_ifaddr' from incompatible pointer type [-Werror] if (udp_get_ifaddr(fd, ifname, &ms.imr_interface) == -1) { ^ src/udp.c:123:1: note: expected 'struct in_addr *' but argument is of type '__be32 *' udp_get_ifaddr( int fd, const char *ifname, struct in_addr *addr ) ^ cc1: all warnings being treated as errors
Because in android ndk the imr_multiaddr in ip_mreq_source struct is __be32
https://chromium.googlesource.com/android_tools/+/20ee6d20/ndk/platforms/android-21/arch-arm64/usr/include/linux/in.h#167
struct ip_mreq_source { /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ __be32 imr_multiaddr; __be32 imr_interface; __be32 imr_sourceaddr; };
History
Updated by Jaroslav Kysela over 7 years ago
This is android bug: https://android-review.googlesource.com/#/c/342781/