Subject: RE: Visual Studio 6 compilation issues (libssh2 1.2.4)

RE: Visual Studio 6 compilation issues (libssh2 1.2.4)

From: Neil Gierman <>
Date: Tue, 9 Mar 2010 10:40:38 -0600

> > If someone could send a patch, I can test against Visual Studio 2008
> > (Win32/x64/Itanium).
> Try this. Seems ok on VS 2005.

Well that patch didn't break things although there is another issue.

I noticed 446 compiler warnings related to data type conversions when
compiling in VS2008 Itanium mode. They are mostly size_t to unsigned
long/int conversion warnings. We have defined that in most places the length
of messages and packets to be unsigned long or unsigned int. In most places
we are storing the return of strlen() and other related function in to our
length variables. An example is the definition of libssh2_error() where we
are storing the return of strlen(errmsg) into session->err_msglen. Strlen
returns size_t and in Win64 builds, size_t = unsigned __int64. Long = 4
bytes, __int64 = 8bytes
( There are
quite a number of changes to sync up data types to match size_t and I don't
know if some of those would break the API/ABI. Or we could go the easy way
and cast the returns of strlen, etc to unsigned long (or whatever we want it
as) however I think that is masking a future problem.

Received on 2010-03-09