Comments (7)
I agree, no warnings would be ideal. But remember that we cannot change any types in the public API/ABI so where unsigned int
is used today we cannot freely change it to size_t
.
In the (1) case we need a typecast in that macro. The (2) thing is part of the protocol, isn't it?
Feel free to submit pull requests to fix warnings.
from libssh2.
remember that we cannot change any types in the public API/ABI so where unsigned int is used today we cannot freely change it to size_t.
I'm primarily interested in a practical solution to my current problem, which is that I see lots of compiler warnings, all of which are extremely useful to find 64-bit bugs in general. So I don't want to disable them, not even for a single translation unit.
On the other hand this means I cannot use the libssh2 function macros since they are not type-correct. One mitigation might be to add type casts to the macros.
This leaves the problem to the _ex functions only, but at least I can then type-cast on my own code, which is still wordy and ugly since I would prefer an API without the "len" parameters, which seem about CPU-perf optimization only.
The (2) thing is part of the protocol, isn't it?
Yes, maybe it's time to upgrade to a newer version of the spec?
https://filezilla-project.org/specs/draft-ietf-secsh-filexfer-13.txt
Just to clarify, I'm no expert in this area at all, basically I know SFTP and libssh2 for a week now :)
Feel free to submit pull requests to fix warnings.
I'm a C++ programmer, so I would probably fail to get the C style right. Still I created a patch adding the C-casts, but chances are it won't work since I use code-formatting in my projects.
I'l try to attach it...
from libssh2.
Sure we could implement support for a newer SFTP version. I don't think anyone will object to that. But that is a rather big undertaking that I'm not personally prepared to do anytime soon. We'll welcome help and patches of course!
from libssh2.
Would it be reasonable to define a new type, say libssh2_size_t
, and use that instead? Then it could be a configuration option whether to stay ABI-compatible with the deployed library (via typedef unsigned int libssh2_size_t
) or to use the system size_t
.
The latter would be useful to those embedding libssh2
who don't have to worry about ABI-compatibility, and it would also allow building it with the system size_t
locally just to run tests.
from libssh2.
Seems like a reasonable approach to me!
from libssh2.
I wrote that up as a separate issue (#29) since it wouldn't actually address these compiler warnings in many cases, but (I think) it would be a good general cleanup.
from libssh2.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
from libssh2.
Related Issues (20)
- Authentication failed with Empty password
- Tests test_sshd.test 1 and 2 fail when environment variable $USER is not set HOT 3
- Error while buidling libssh2 v1.11 using nmake and nmakefile in WINDOWS HOT 2
- Use LIBSSH2_NO_DEPRECATED to mark DEPRECATED APIs.
- [deleted]
- Feature request: Copying a file on SFTP to another directory without roundtrip HOT 1
- libssh2 don't support windows XP HOT 2
- I just created a sftp-document-provider for Android using libssh2
- I am trying to compile libssh2 as a static library with openSSL 3 but I am getting a of LNK errors in WINDOWS with cmake. HOT 2
- Add support for "strict KEX" protocol extension HOT 1
- Release request (terrapin) HOT 1
- Make a new release to include fix for CVE-2023-48795 HOT 1
- libssh2 1.11.1 release? (with CVE-2023-48795 fix)
- Encryption failure during handshake when using libssh2 and wolfssl HOT 7
- How can I get more descriptive error messages?
- ssh from docker container on arm64 macos ventura to same mac (docker host) fails, ERROR: SSH handshake failed. HOT 1
- (question) when is the terrapin fix going to be released? HOT 1
- libssh2 in PHP: how can I check the supported ciphers and mac algorithms HOT 1
- compilation error with cmake, without passing -DENABLE_ZLIB_COMPRESSION=ON HOT 2
- Unused code setting channel ignore mode HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libssh2.