To avoid the chance of breaking compatibility. Make an exception for
values also passed to `strlen()` because these were already not
supporting callers passing `x, y`-style macro expressions to these
macros, as arguments.
Also note that SFTP handle args already did not support this due to the
lack of parentheses in `libssh2_sftp_close()`, `libssh2_sftp_closedir()`
macros.
Follow-up to b6f307dca9#1898Closes#2577
Also:
- sync with canonical `BSD-3-Clause.txt`:
- number the clauses.
- wording in the 3rd clause.
- add 'All rights reserved.' where missing.
- agent: sync with rest of files.
- agent: merge two, identical, embedded headers.
- fix comments nits found nearby.
Closes#2247
- sync picky compiler warning options with curl:
- update version mappings for latest Apple clang.
- replace `-pedantic` with `-Wpedantic` on newer toolchains.
- adjust warning cutoff versions.
- enable new picky warnings.
- unlock picky warnings for most recent MSVC.
- GHA: bump some MSVC jobs to to VS2026.
Fix fallouts:
- configure: replace `-I` with `-isystem` for dependency headers.
Notably it silences picky warnings otherwise found in 3rd-party
headers, e.g. `-Wreserved-identifier` in `gpg-error.h`,
`openssl/lhash.h`, `wolfssl/wolfcrypt/hmac.h`, or
`-Wcast-function-type-strict` in `openssl/rsa.h`.
It also aligns autotools builds with CMake (and curl builds).
Logic copied from curl.
- example/x11: fix to not use reserved symbols.
- include, src/libssh2_priv.h: silence `-Wreserved-identifier` locally.
May be fixed for real in a future patch.
- avoid using reserved C++ keyword `public`.
- openssl: silence `-Wcast-function-type-strict` locally for
non-OpenSSL3 builds.
- mbedtls, openssl: fix potentially uninitialized variable warnings.
(extend to all compilers from MSVC in openssl)
- fix `LIBSSH2_SOCKET_MASK` signedness on Windows.
- wincng: apply casts from `int` to `enum` to silence
`-Wimplicit-int-enum-cast`.
- configure: disable `-Wleading-whitespace=spaces` to due
incompatibility with `AC_FUNC_ALLOCA`.
- packet: fix to pass `int` as mask length.
- fix `-Wformat-signedness`.
- src/libssh2_priv.h: silence `-Wreserved-macro-identifier` locally for
mingw-w64 builds.
- GHA: add workaround for missing NSIS on windows-2025 runner images.
Closes#1972
Move `LIBSSH2_API` inline, too.
Also:
- fix missing argument names from a function typedef.
- fix pointer argument formatting.
Follow-up to e85ce25b4c#1960
Follow-up to 6ffb96321c#1935Closes#1964
- All files have prominent copyright and SPDX identifier
- If not embedded in the file, in the .reuse/dep5 file
- All used licenses are in LICENSES/ (not shipped in tarballs)
- A new REUSE CI job verify that all files are OK
Assisted-by: Viktor Szakats
Closes#1084
Also:
- uppercase `(C)`.
- add missing 'All rights reserved.' lines.
- drop duplicate 'Author' lines.
- add copyright headers where missing.
- enable copyright header check in checksrc.
Reasons for deleting years (copied as-is from curl):
- they are mostly pointless in all major jurisdictions
- many big corporations and projects already don't use them
- saves us from pointless churn
- git keeps history for us
- the year range is kept in COPYING
Closes#1082
calling functions to support that with the following API notes:
* libssh2_publickey_shutdown(), libssh2_session_free() changed
to return an "int" to allow signaling of LIBSSH2_ERROR_EAGAIN.
* libssh2_scp_recv(), libssh2_scp_send_ex() and libssh2_sftp_init()
will loop in on libssh2_channel_free() when there is an error.
It is not possible to return LIBSSH2_ERROR_EAGAIN in this condition
in these 3 functions and not lose the original error code.
the recent commits converted the tabs to 4 spaces, which matched the
initial indent size. Other commits converted the tabs to 8 spaces, this
didn't match.
All the code has been converted to 4 space indents. No changes to line
lengths or actual code was performed. This is in preperation to my up
coming non-blocking work so my commits should only be code changes and
line lengths in the code I am working on.