1
0
mirror of https://github.com/libssh2/libssh2.git synced 2026-10-24 03:48:58 +03:00
Files
libssh2/example
Viktor Szakats e8e6bc2c50 build: improve building in ISO and C89 modes, test in CI
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 a683133dfe #999

Assisted-by: Raul Tambre
Ref: #1674

Closes #1688
2026-04-08 15:30:16 +02:00
..
2025-12-26 21:22:11 +01:00
2024-08-06 10:56:22 +02:00
2025-12-26 21:22:11 +01:00