Repository navigation
Conversation
``` src/channel.c(371,63): error : cast from 'const char *' to 'unsigned char *' drops const qualifier [-Werror,-Wcast-qual] src/channel.c(1046,40): error : cast from 'const char *' to 'char *' drops const qualifier [-Werror,-Wcast-qual] src/channel.c(1154,40): error : cast from 'const char *' to 'char *' drops const qualifier [-Werror,-Wcast-qual] src/channel.c(1314,40): error : cast from 'const char *' to 'char *' drops const qualifier [-Werror,-Wcast-qual] src/channel.c(1578,55): error : cast from 'const char *' to 'unsigned char *' drops const qualifier [-Werror,-Wcast-qual] src/channel.c(2486,58): error : cast from 'const char *' to 'unsigned char *' drops const qualifier [-Werror,-Wcast-qual] src/comp.c(93,31): error : cast from 'const unsigned char *' to 'unsigned char *' drops const qualifier [-Werror,-Wcast-qual] src/openssl.c(81,40): error : cast from 'const char *' to 'char *' drops const qualifier [-Werror,-Wcast-qual] [...] ```
Some OpenSSL functions are accepting non-const strings, which need to be fed with literals. improve LIBSSH2_UNCONST improve LIBSSH2_UNCONST 2 strip const strip const strip const strip const strip const strip const strip const strip const strip const wincng
add const
add missing const add missing const add missing const add missing const add missing const add missing const
OPENSSL_VERSION_NUMBER is set to a conservative value by default in wolfSSL, but its implementation of this function matches with OpenSSL 1.1.0 and upper.
-Wcast-qual, fix fallouts-Wcast-qual, fix fallouts
MingcongBai
pushed a commit
to AOSC-Tracking/libssh2
that referenced
this pull request
Jun 26, 2026
- enable compiler warning `-Wcast-qual`. - add `LIBSSH2_UNCONST()` macro to strip const where absolutely necessary to avoid compiler warnings. - fix const stripping by constifying where necessary. - fix const stripping by using `LIBSSH2_UNCONST()`. - libgcrypt.h: drop unnecessary casts. - openssl: fix to use new `BIO_new_mem_buf()` parameter types with wolfSSL. Cherry-picked from libssh2#1484 Closes libssh2#1527 Signed-off-by: Mingcong Bai <[email protected]>
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.
-Wcast-qual.LIBSSH2_UNCONST()macro to strip const where absolutelynecessary to avoid compiler warnings.
LIBSSH2_UNCONST().BIO_new_mem_buf()parameter typeswith wolfSSL.
Cherry-picked from #1484