Skip to content

lib: include necessary headers for inet_ntop/inet_pton - #16188

Closed
vszakats wants to merge 7 commits into
curl:masterfrom
vszakats:freebsd-pton
Closed

vszakats wants to merge 7 commits into
curl:masterfrom
vszakats:freebsd-pton

Conversation

@vszakats

@vszakats vszakats commented Feb 5, 2025 •

Copy link
Copy Markdown
Member

Include netinet/in.h for FreeBSD/OpenBSD. Also include sys/socket.h
just in case, based on earlier code in tests/libtest/lib1960.c.

Also:

  • document these in CMakeLists.txt.
  • add a CI job testing FreeBSD with no unity and no test bundles.
    (without running tests to keep it fast)

FreeBSD (autotools):

../../../tests/libtest/lib1960.c:66:22: error: variable has incomplete type 'struct sockaddr_in'
   66 |   struct sockaddr_in serv_addr;
      |                      ^
../../../tests/libtest/lib1960.c:66:10: note: forward declaration of 'struct sockaddr_in'
   66 |   struct sockaddr_in serv_addr;
      |          ^

Ref: https://github.com/curl/curl/actions/runs/13159721509/job/36725114118?pr=16188#step:3:5289

OpenBSD (cmake):

/home/runner/work/curl/curl/tests/libtest/lib1960.c:66:22: error: variable has incomplete type 'struct sockaddr_in'
  struct sockaddr_in serv_addr;
                     ^
/home/runner/work/curl/curl/tests/libtest/lib1960.c:66:10: note: forward declaration of 'struct sockaddr_in'
  struct sockaddr_in serv_addr;
         ^
1 error generated.

Ref: https://github.com/curl/curl/actions/runs/13159721509/job/36725102004?pr=16188#step:3:2166

Reported-by: CueXXIII on Github
Fixes #16184
Follow-up to a3585c9 #15543

@github-actions github-actions Bot added the CI Continuous Integration label Feb 5, 2025
@vszakats vszakats changed the title [WIP] inet_pton.h: add necessary header for FreeBSD [WIP] lib: include necessary headers for inet_ntop/inet_pton (e.g. on FreeBSD) Feb 5, 2025
@vszakats vszakats changed the title [WIP] lib: include necessary headers for inet_ntop/inet_pton (e.g. on FreeBSD) [WIP] lib: include necessary headers for inet_ntop/inet_pton (e.g. FreeBSD/OpenBSD) Feb 5, 2025
@vszakats vszakats changed the title [WIP] lib: include necessary headers for inet_ntop/inet_pton (e.g. FreeBSD/OpenBSD) [WIP] lib: include necessary headers for inet_ntop/inet_pton Feb 5, 2025
@vszakats vszakats changed the title [WIP] lib: include necessary headers for inet_ntop/inet_pton lib: include necessary headers for inet_ntop/inet_pton Feb 5, 2025
@vszakats vszakats closed this in 6fc7039 Feb 5, 2025
@vszakats
vszakats deleted the freebsd-pton branch February 5, 2025 15:29
vszakats added a commit that referenced this pull request Feb 5, 2025
To save time. They are built the same way in the other jobs.

Follow-up to 6fc7039 #16188
Closes #16195
pps83 pushed a commit to pps83/curl that referenced this pull request Apr 26, 2025
Include `netinet/in.h` for FreeBSD/OpenBSD. Also include `sys/socket.h`
just in case, based on earlier code in `tests/libtest/lib1960.c`.

Also:
- document these in `CMakeLists.txt`.
- add a CI job testing FreeBSD with no unity and no test bundles.
  (without running tests to keep it fast)

FreeBSD (autotools):
```
../../../tests/libtest/lib1960.c:66:22: error: variable has incomplete type 'struct sockaddr_in'
   66 |   struct sockaddr_in serv_addr;
      |                      ^
../../../tests/libtest/lib1960.c:66:10: note: forward declaration of 'struct sockaddr_in'
   66 |   struct sockaddr_in serv_addr;
      |          ^
```
Ref: https://github.com/curl/curl/actions/runs/13159721509/job/36725114118?pr=16188#step:3:5289

OpenBSD (cmake):
```
/home/runner/work/curl/curl/tests/libtest/lib1960.c:66:22: error: variable has incomplete type 'struct sockaddr_in'
  struct sockaddr_in serv_addr;
                     ^
/home/runner/work/curl/curl/tests/libtest/lib1960.c:66:10: note: forward declaration of 'struct sockaddr_in'
  struct sockaddr_in serv_addr;
         ^
1 error generated.
```
Ref: https://github.com/curl/curl/actions/runs/13159721509/job/36725102004?pr=16188#step:3:2166

Reported-by: CueXXIII on Github
Fixes curl#16184
Follow-up to a3585c9 curl#15543
Closes curl#16188
pps83 pushed a commit to pps83/curl that referenced this pull request Apr 26, 2025
To save time. They are built the same way in the other jobs.

Follow-up to 6fc7039 curl#16188
Closes curl#16195
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build CI Continuous Integration tests

Development

Successfully merging this pull request may close these issues.

Test libtest1960 fails to compile on FreeBSD 14.2

1 participant