error: unknown type name 'in_addr_t'
- Dominant language
- C
- Stars
- 0
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
When compiling [Valkey](https://github.com/zyuiop/hermit-valkey/) using the latest version of hermit-gcc, the following problem occurs:
```
3.299 In file included from /opt/hermit/x86_64-hermit/include/netinet/in.h:4,
3.299 from sockcompat.h:40,
3.299 from net.c:47:
3.299 /opt/hermit/x86_64-hermit/include/arpa/inet.h:21:1: error: unknown type name 'in_addr_t'; did you mean 'caddr_t'?
3.299 21 | in_addr_t inet_addr(const char *cp);
3.299 | ^~~~~~~~~
3.299 | caddr_t
3.300 /opt/hermit/x86_64-hermit/include/netinet/in.h:14:5: error: unknown type name 'in_addr_t'; did you mean 'caddr_t'?
3.300 14 | in_addr_t s_addr;
3.300 | ^~~~~~~~~
3.300 | caddr_t
3.300 /opt/hermit/x86_64-hermit/include/netinet/in.h:24:5: error: unknown type name 'in_port_t'; did you mean 'intptr_t'?
3.300 24 | in_port_t sin_port;
3.300 | ^~~~~~~~~
3.300 | intptr_t
3.301 /opt/hermit/x86_64-hermit/include/netinet/in.h:32:5: error: unknown type name 'in_port_t'; did you mean 'intptr_t'?
3.301 32 | in_port_t sin6_port;
3.301 | ^~~~~~~~~
3.301 | intptr_t
```
Here is the dockerfile used
```dockerfile
FROM ghcr.io/hermit-os/hermit-gcc:x86_64 AS builder
ENV CC="x86_64-hermit-gcc"
ENV CFLAGS="-DAF_UNIX=99 -DAF_LOCAL=99 -DTIOCGWINSZ=0x5413 -fPIE"
ENV LDFLAGS="-L/hermit -Wl,--as-needed -Wl,--no-undefined -pie -Wl,--whole-archive -Wl,--start-group /hermit/libhermit.a -Wl,--end-group -Wl,--no-whole-archive -pthread"
ENV DEB_HOST_GNU_TYPE="x86_64-hermit"
ENV JEMALLOC_CONFIGURE_OPTS="--disable-syscall"
ARG LIBHERMIT=libhermit.a
WORKDIR /valkey
COPY valkey /valkey
ADD $LIBHERMIT /hermit/libhermit.a
RUN make distclean
RUN make valkey-server MALLOC=libc
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the build with the provided Dockerfile and hermit-gcc command, then inspect /opt/hermit/x86_64-hermit/include/arpa/inet.h, netinet/in.h, and the declarations included by sockcompat.h. Trace where in_addr_t and in_port_t should be defined and compare that with the include order used by net.c. Done means the Valkey build no longer reports these unknown-type errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, docker
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 64/100