Repository navigation
Conversation
vszakats
force-pushed
the
header-tidy
branch
5 times, most recently
from
April 27, 2023 09:39
8c1a60d to
200c554
Compare
No need to check for `WIN32`, `HAVE_SYS_SELECT_H` guard is enough. `sys/types.h` is always included by `libssh2.h` anyway.
Already included via `libssh2.h`.
agreppin
pushed a commit
to agreppin/libssh2
that referenced
this pull request
Jul 14, 2024
- drop unused or duplicate C headers. - add missing ones (that worked by chance). (`string.h`, `stdlib.h`) - mention the functions that need certain headers. - move some headers from crypto header to crypto C source. - reorder headers in some places. - simplify the #if tree for `sys/select.h` in `libssh2_priv.h`. - move scp-specific macros next to their header to `scp.c` Follow-up to 5db836b Closes libssh2#999
vszakats
added a commit
to vszakats/libssh2
that referenced
this pull request
Apr 7, 2026
Follow-up to a683133 libssh2#999 Also causing this strict ISO builds: ``` /home/runner/work/libssh2/libssh2/example/direct_tcpip.c:67:20: error: variable has incomplete type 'struct timeval' 67 | struct timeval tv; | ^ /home/runner/work/libssh2/libssh2/example/direct_tcpip.c:67:12: note: forward declaration of 'struct timeval' 67 | struct timeval tv; | ^ /home/runner/work/libssh2/libssh2/example/direct_tcpip.c:249:9: error: use of undeclared identifier 'fd_set' 249 | fd_set fds; | ^ /home/runner/work/libssh2/libssh2/example/direct_tcpip.c:250:9: error: call to undeclared function 'FD_ZERO'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 250 | FD_ZERO(&fds); | ^ /home/runner/work/libssh2/libssh2/example/direct_tcpip.c:250:18: error: use of undeclared identifier 'fds' 250 | FD_ZERO(&fds); | ^ /home/runner/work/libssh2/libssh2/example/direct_tcpip.c:255:9: error: call to undeclared function 'FD_SET'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 255 | FD_SET(forwardsock, &fds); | ^ /home/runner/work/libssh2/libssh2/example/direct_tcpip.c:255:30: error: use of undeclared identifier 'fds' 255 | FD_SET(forwardsock, &fds); | ^ /home/runner/work/libssh2/libssh2/example/direct_tcpip.c:261:14: error: call to undeclared function 'select'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 261 | rc = select((int)(forwardsock + 1), &fds, NULL, NULL, &tv); | ^ /home/runner/work/libssh2/libssh2/example/direct_tcpip.c:261:46: error: use of undeclared identifier 'fds' 261 | rc = select((int)(forwardsock + 1), &fds, NULL, NULL, &tv); | ^ /home/runner/work/libssh2/libssh2/example/direct_tcpip.c:270:18: error: call to undeclared function 'FD_ISSET'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 270 | if(rc && FD_ISSET(forwardsock, &fds)) { | ^ /home/runner/work/libssh2/libssh2/example/direct_tcpip.c:270:41: error: use of undeclared identifier 'fds' 270 | if(rc && FD_ISSET(forwardsock, &fds)) { | ^ 10 errors generated. ``` https://github.com/libssh2/libssh2/actions/runs/24107290427/job/70333563236
vszakats
added a commit
to vszakats/libssh2
that referenced
this pull request
Apr 8, 2026
Follow-up to a683133 libssh2#999 Also causing this strict ISO builds: ``` /home/runner/work/libssh2/libssh2/example/direct_tcpip.c:67:20: error: variable has incomplete type 'struct timeval' 67 | struct timeval tv; | ^ /home/runner/work/libssh2/libssh2/example/direct_tcpip.c:67:12: note: forward declaration of 'struct timeval' 67 | struct timeval tv; | ^ /home/runner/work/libssh2/libssh2/example/direct_tcpip.c:249:9: error: use of undeclared identifier 'fd_set' 249 | fd_set fds; | ^ /home/runner/work/libssh2/libssh2/example/direct_tcpip.c:250:9: error: call to undeclared function 'FD_ZERO'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 250 | FD_ZERO(&fds); | ^ /home/runner/work/libssh2/libssh2/example/direct_tcpip.c:250:18: error: use of undeclared identifier 'fds' 250 | FD_ZERO(&fds); | ^ /home/runner/work/libssh2/libssh2/example/direct_tcpip.c:255:9: error: call to undeclared function 'FD_SET'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 255 | FD_SET(forwardsock, &fds); | ^ /home/runner/work/libssh2/libssh2/example/direct_tcpip.c:255:30: error: use of undeclared identifier 'fds' 255 | FD_SET(forwardsock, &fds); | ^ /home/runner/work/libssh2/libssh2/example/direct_tcpip.c:261:14: error: call to undeclared function 'select'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 261 | rc = select((int)(forwardsock + 1), &fds, NULL, NULL, &tv); | ^ /home/runner/work/libssh2/libssh2/example/direct_tcpip.c:261:46: error: use of undeclared identifier 'fds' 261 | rc = select((int)(forwardsock + 1), &fds, NULL, NULL, &tv); | ^ /home/runner/work/libssh2/libssh2/example/direct_tcpip.c:270:18: error: call to undeclared function 'FD_ISSET'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 270 | if(rc && FD_ISSET(forwardsock, &fds)) { | ^ /home/runner/work/libssh2/libssh2/example/direct_tcpip.c:270:41: error: use of undeclared identifier 'fds' 270 | if(rc && FD_ISSET(forwardsock, &fds)) { | ^ 10 errors generated. ``` https://github.com/libssh2/libssh2/actions/runs/24107290427/job/70333563236
vszakats
added a commit
that referenced
this pull request
Apr 8, 2026
Note: On Linux with glibc, ISO mode also requires setting the `_DEFAULT_SOURCE` macro to enable necessary POSIX features when building tests (for `popen()`, `pclose()` and examples (for `fileno()`, `tcsetattr()`). On other platforms and environments it may require something else. - replace `strdup()` with local implementation. - replace `getline()` with C89 `fgets()`. - replace `u_char`, `u_int` with C89 types. - fix type mismatches in chacha-poly1305 code. - silence `-Wno-format-nonliteral` locally. The global method was not effective (like because it was overridden by `-Wformat=2`) and caused these warnings when building in C89 mode. - GHA: test ISO C89 in zlib-enabled Linux jobs with all crypto backends. - fix formatting nits along the way. - configure, cmake: silence silly `-Wno-comma` warnings with clang in C89 mode. - examples: include `select.h` again, where `select()` is used. As its canonical header. Seen required on Linux glibc non-GNU/ISO builds. Follow-up to a683133 #999 Assisted-by: Raul Tambre Ref: #1674 Closes #1688
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(
string.h,stdlib.h)sys/select.hinlibssh2_priv.h.scp.cFollow-up to 5db836b
Closes #999