Subject: Re: Windows Warnings

Re: Windows Warnings

From: Chris Hanson <cmhanson_at_eschatologist.net>
Date: Wed, 26 Jun 2019 12:12:08 -0700

On Jun 26, 2019, at 3:45 AM, Narayan Subramanian <Narayan.Subramanian_at_veritas.com> wrote:
>
> Though Windows builds fine, there are SEVERAL build warnings. Is this normal?
>
> FYI, I am using Visual Studio 2017 and libssh2 1.9.
>
> I have attached the log file.
> Most of the warnings are data conversion / truncation warnings. E.g:
> E:\libssh2\src\knownhost.c(174): warning C4267: 'function': conversion from 'size_t' to 'unsigned int', possible loss of data
>
> These shouldn’t be difficult to fix. Should we work towards fixing these? I don’t mind contributing towards this. These may be reviewed and tested.

Before assuming all such warnings should be fixed by changing types, take a look at the effect that changing these types would have.

For example, if an exported function returns unsigned int and you get a warning like that, you can’t just change its return type without also changing the ABI of the library. Since that would mean a new version of the library isn’t a binary-compatible drop-in replacement for the old version, that means you would need to find some other way to address the warning.

  -- Chris

_______________________________________________
libssh2-devel https://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2019-06-26