www.libssh2.org | Daily snapshots | Mailing list archive | Docs | Examples | github

Archive Index This month's Index

Subject: RE: [PATCH] Added Windows Cryptography API: Next Generation backend

RE: [PATCH] Added Windows Cryptography API: Next Generation backend

From: Bob Kast <bob_2824_at_hotmail.com>
Date: Wed, 19 Mar 2014 09:11:25 -0400

> By all means post the patches, but, if you're talking about the warnings I
think
> you are, casting isn't a fix. The proper fix is to change the API to take
wider
> types, but we are reluctant to do that, as that would change the ABI
forcing a
> soname bump.

I think the problem is more widespread. For example, in Windows, size_t is
an integer the size of a pointer, while int and long are always 32 bits.
This means that in 64 bit Windows, assigning strlen() to an int will not
complain in 32 bit Windows but it will in 64 bit Windows. This applies to
anything returning size_t, such as sizeof(). It is crazy that strlen()
returns size_t since a string is generally not longer than 2^32 characters.
Libssh2 uses size_t all over. A 64 bit compile results in about 200
warnings. A 32 bit compile has much fewer warnings.

Casting is not a fix, but it does mean that someone has looked at it and
determined that this is a false positive and suppressed the warning.

I can't maintain code with warnings, so my current fix is to include this:

#pragma warning(disable: 4244 4267)

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2014-03-19

the libssh2 team