1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-07-29 13:01:14 +03:00

build: enable -Wcast-qual, fix fallouts

- 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 #1484
Closes #1527
This commit is contained in:
Viktor Szakats
2025-01-30 21:18:23 +01:00
parent 96cbe61896
commit 606c102e52
22 changed files with 146 additions and 114 deletions

View File

@ -84,7 +84,7 @@ int main(int argc, char *argv[])
LIBSSH2_AGENT *agent = NULL;
struct libssh2_agent_publickey *identity, *prev_identity = NULL;
int exitcode;
char *exitsignal = (char *)"none";
char *exitsignal = NULL;
ssize_t bytecount = 0;
#ifdef _WIN32
@ -272,7 +272,8 @@ int main(int argc, char *argv[])
}
if(exitsignal) {
fprintf(stderr, "\nGot signal: %s\n", exitsignal);
fprintf(stderr, "\nGot signal: %s\n",
exitsignal ? exitsignal : "none");
}
else {
fprintf(stderr, "\nEXIT: %d bytecount: %ld\n",