From libssh2-devel-bounces@cool.haxx.se  Mon Jul  1 07:44:35 2019
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (mail [127.0.0.1])
	by giant.haxx.se (8.15.2/8.15.2/Debian-4) with ESMTP id x615hr46027537;
	Mon, 1 Jul 2019 07:44:22 +0200
Received: from mail1.bemta24.messagelabs.com (mail1.bemta24.messagelabs.com
 [67.219.250.115])
 by giant.haxx.se (8.15.2/8.15.2/Debian-4) with ESMTPS id x615hoox027521
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT)
 for <libssh2-devel@cool.haxx.se>; Mon, 1 Jul 2019 07:43:51 +0200
Received: from [67.219.250.197] (using TLSv1.2 with cipher
 DHE-RSA-AES256-GCM-SHA384 (256 bits))
 by server-4.bemta.az-b.us-west-2.aws.symcld.net id C1/C9-10795-19D991D5;
 Mon, 01 Jul 2019 05:43:45 +0000
X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrNJsWRWlGSWpSXmKPExsUi9LZng+6EuZK
 xBvPfmVosnbuZ1YHR4+KZ6SwBjFGsmXlJ+RUJrBlnzu5gLjijUTHv4h72BsYOjS5GLg4Wge3M
 EhPXPmEDcYQEJjBJ7H6wlQnCuccocfLLRsYuRk4ONgFrifeT2llBbBEBW4m/6xexgdjCArISU
 y/3MULE5STuzT7MBmHrSby4/ZEJxGYRUJE4evkYWJxXwE6i6/IrMJtRQEzi+6k1YDXMAuISt5
 7MB7MlBAQkluw5zwxhi0q8fPwPbK+ogL7Ej+03oXoTJb6vO8IKUaMssfzIbaheWYlL87sZIWx
 fiQ9T17CDPCMh8JhR4sCXY1BFWhILjjyHapaS+P74I1ARB5CdI3F+gjtEWF2i5eM8qBIZiY/b
 prBBzLnIJnH7+XGw44QEkiX+f9oPdaicxKrehywQRReYJd68Ws4IMpRZQFNi/S59iCc9JJb3r
 WWGsBUlpnQ/ZJ/AqD0Lyf+zEDpmIemYhaRjFjgYBSVOznzCsoCRdRWjRVJRZnpGSW5iZo6uoY
 GBrqGhka6hsTGQbaKXWKWbpFdarFueWlyia6SXWF6sV1yZm5yTopeXWrKJEZhyUgpaM3YwTpr
 1Ru8QoyQHk5IoL89vsVghvqT8lMqMxOKM+KLSnNTiQ4wyHBxKEryuEyRjhQSLUtNTK9Iyc4Dp
 DyYtwcGjJMJbDJLmLS5IzC3OTIdInWL05pjwcu4iZo53PxcDyfkblwDJm+9B5Oa5S4HkERApx
 JKXn5cqJc5bADJCAGRERmke3AJYGr/EKCslzMvIwMAgxFOQWpSbWYIq/4pRnINRSZj3RT/QFJ
 7MvBK4O14BncgEdGJGlRjIiSWJCCmpBiaeswKf9v/cw5b/9ffU/r1sUd61ngJOJ3QO+Dqd38l
 3a37Dm425L6YE9Btb7DmqkdnoqM7xdPGsC2bufKLRtbXK3vnZuVNk6wqabsVuvqkbIhh75NEh
 vxynpTwCuyZ8/b6F5VLl8p4Xy48dvcK2M2CfeEWV2IWGEK24Rxc115wOTTJVvW+QEFX5tVs/i
 Jl13aHNGl3ur1O/ljQHFxy9KlHKdiRC+Maa26qynSf2/pfc+prPo3v1nqscS3ZqXE8QunT2il
 7NjEBWq7D0PS8zpm2XSNV4ZNKVqHIm5+UdYd5MV7FjG3/H7gpsFHtzTjUnp3hO34pf8pOVBZd
 vUQ7SfyrhFa6obLzXcNdaBpv650osxRmJhlrMRcWJAOj7iP5eBAAA
X-Env-Sender: Narayan.Subramanian@veritas.com
X-Msg-Ref: server-4.tower-345.messagelabs.com!1561959823!317258!1
X-Originating-IP: [18.237.140.176]
X-SYMC-ESS-Client-Auth: mailfrom-relay-check=pass
X-StarScan-Received: 
X-StarScan-Version: 9.43.9; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30540 invoked from network); 1 Jul 2019 05:43:44 -0000
Received: from ec2-18-237-140-176.us-west-2.compute.amazonaws.com (HELO
 mail.ds.dlp.protect.symantec.com) (18.237.140.176)
 by server-4.tower-345.messagelabs.com with ECDHE-RSA-AES256-SHA384 encrypted
 SMTP; 1 Jul 2019 05:43:44 -0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=veritastech.onmicrosoft.com; s=selector2-veritastech-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=eVcT0ICZg8mU5NWOCeTTb7I/Y4PKt+A79w9sIWVLlIw=;
 b=VSeyBY2EmT2nJtuzt2qqSSYgVU2j4xlCMnL9RrdAtrrBcgq5kU20krC2C4K5sgC7DcvJpyc+Vh7wWEVXkkAoBUBmsUV8R0i0q7dWJvtlwBIf2DNOEiSpDV1EK6wDfzVVNdua5AICDpYSPh5IA23l8/6O598ilTJEDcuI2r9Vmck=
Received: from DM6PR20MB2956.namprd20.prod.outlook.com (10.141.164.214) by
 DM6PR20MB2332.namprd20.prod.outlook.com (20.179.161.97) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.2032.20; Mon, 1 Jul 2019 05:43:41 +0000
Received: from DM6PR20MB2956.namprd20.prod.outlook.com
 ([fe80::65d1:9320:6738:bf4c]) by DM6PR20MB2956.namprd20.prod.outlook.com
 ([fe80::65d1:9320:6738:bf4c%4]) with mapi id 15.20.2008.020; Mon, 1 Jul 2019
 05:43:40 +0000
From: Narayan Subramanian <Narayan.Subramanian@veritas.com>
To: "libssh2-devel@cool.haxx.se" <libssh2-devel@cool.haxx.se>
Subject: Re: Windows Warnings
Thread-Topic: Windows Warnings
Thread-Index: AQHVL8/vCJCVfY3V30eHq39uJQ7E3g==
Date: Mon, 1 Jul 2019 05:43:40 +0000
Message-ID: <62CC3F4B-C737-448F-94BE-BFE7735C6DED@veritas.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
user-agent: Microsoft-MacOutlook/10.19.0.190512
x-originating-ip: [165.225.106.129]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: 0df47a24-8bd6-482e-0fef-08d6fde71284
x-microsoft-antispam: BCL:0; PCL:0;
 RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020);
 SRVR:DM6PR20MB2332; 
x-ms-traffictypediagnostic: DM6PR20MB2332:
x-ms-exchange-purlcount: 2
x-microsoft-antispam-prvs: <DM6PR20MB23322925B277D19814E7561EECF90@DM6PR20MB2332.namprd20.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:10000;
x-forefront-prvs: 00851CA28B
x-forefront-antispam-report: SFV:NSPM;
 SFS:(10009020)(4636009)(366004)(39860400002)(136003)(396003)(376002)(346002)(27574002)(189003)(199004)(2501003)(6436002)(5640700003)(25786009)(66946007)(66476007)(66556008)(64756008)(66446008)(73956011)(6486002)(5660300002)(53936002)(2906002)(6246003)(6512007)(6306002)(316002)(86362001)(72206003)(58126008)(91956017)(76116006)(229853002)(33656002)(26005)(102836004)(2616005)(221733001)(186003)(486006)(476003)(8936002)(7736002)(8676002)(81166006)(81156014)(6916009)(7116003)(478600001)(2351001)(99286004)(53546011)(6506007)(55236004)(5024004)(256004)(14444005)(66066001)(36756003)(14454004)(68736007)(966005)(3480700005)(6116002)(3846002)(71200400001)(71190400001)(305945005);
 DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR20MB2332;
 H:DM6PR20MB2956.namprd20.prod.outlook.com; FPR:; SPF:None; LANG:en;
 PTR:InfoNoRecords; MX:1; A:1; 
received-spf: None (protection.outlook.com: veritas.com does not designate
 permitted sender hosts)
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam-message-info: iinmlLhNpnFt/AlP6gt6P3XeQXK/AjT8mrKTPtFb0IpD++yQJxoqNGXWdHvr2CmpQP4DGmLTFsHv46XmYcxwCHNHquWuHVg74xboiUeqW8FWjaCRj0yb+RHZLadPcdaAsdkSrox1VHd2/UoBmHdw9L5YHT5jw71TlOEZIYFOsmNJFh25RBByfcn5TP4RL5DEglwGM8ieyzY2u0tuCVErR90IvKu2Z51puL/lNbXEUkkAJJd31OV8Nc+clX2KH0p7fxmyLqTpybMQbvGPO4YURMMOQg69kwiU4D7n1yTOoht9w7fFPVxZsk2FW85V9PjpxZz66onZUsWlW7AywDHroHINhJdjbRhUY3+J9tzre//j/mX4Tq2WycsVmqP3xQBs5ICbIxWyuiSsDJ/xZcNRU5fzEF4Ea2U8fRZmieuOSq8=
Content-ID: <C7928A324AFE684BB493B4023A1348FB@namprd20.prod.outlook.com>
MIME-Version: 1.0
X-OriginatorOrg: veritas.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 0df47a24-8bd6-482e-0fef-08d6fde71284
X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Jul 2019 05:43:40.8122 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: fc8e13c0-422c-4c55-b3ea-ca318e6cac32
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: Narayan.Subramanian@veritas.com
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR20MB2332
X-CFilter-Loop: Reflected
X-DetectorID-Processed: 8cd23f87-5a55-4de7-9b51-dd0f7d1caaf5
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id x615hoox027521
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <https://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel/>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <https://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
Content-Type: text/plain; charset="utf-8"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: "libssh2-devel" <libssh2-devel-bounces@cool.haxx.se>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id x615hr46027537

Chris,

Definitely library ABI must not be broken by a fix. Most of these can be fixed using length trimming bitmasks and other such simple transformations.

As an example, for the line in question (E:\libssh2\src\knownhost.c(174)) that yields the warning "warning C4267: 'function': conversion from 'size_t' to 'unsigned int', possible loss of data)"

could be fixed as:

#define TO32BIT(X)	( (X) & UINT_MAX ) //UINT_MAX is 0xFFFFFFFF

        rc = libssh2_base64_decode(hosts->session, &ptr, &ptrlen,
                                   host, TO32BIT(hostlen) );

I'm sure all warnings can be fixed by simple in - place transformations without changing external ABI. 
Let me know what you think ...

Regards,
Narayan

﻿On 27/06/19, 3:36 PM, "libssh2-devel on behalf of libssh2-devel-request@cool.haxx.se" <libssh2-devel-bounces@cool.haxx.se on behalf of libssh2-devel-request@cool.haxx.se> wrote:

    Send libssh2-devel mailing list submissions to
    	libssh2-devel@cool.haxx.se
    
    To subscribe or unsubscribe via the World Wide Web, visit
    	https://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
    or, via email, send a message with subject or body 'help' to
    	libssh2-devel-request@cool.haxx.se
    
    You can reach the person managing the list at
    	libssh2-devel-owner@cool.haxx.se
    
    When replying, please edit your Subject line so it is more specific
    than "Re: Contents of libssh2-devel digest..."
    
    
    Today's Topics:
    
       1. Re: Windows Warnings (Chris Hanson)
    
    
    ----------------------------------------------------------------------
    
    Message: 1
    Date: Wed, 26 Jun 2019 12:12:08 -0700
    From: Chris Hanson <cmhanson@eschatologist.net>
    To: libssh2 development <libssh2-devel@cool.haxx.se>
    Subject: Re: Windows Warnings
    Message-ID: <94D15967-794D-4263-99A9-415182E788E3@eschatologist.net>
    Content-Type: text/plain; charset="utf-8"
    
    On Jun 26, 2019, at 3:45 AM, Narayan Subramanian <Narayan.Subramanian@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
    
    
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: <http://cool.haxx.se/pipermail/libssh2-devel/attachments/20190626/37dde781/attachment-0001.html>
    
    ------------------------------
    
    Subject: Digest Footer
    
    _______________________________________________
    libssh2-devel mailing list
    libssh2-devel@cool.haxx.se
    https://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
    
    
    ------------------------------
    
    End of libssh2-devel Digest, Vol 120, Issue 7
    *********************************************
    


_______________________________________________
libssh2-devel https://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Mon Jul  1 11:23:40 2019
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (mail [127.0.0.1])
	by giant.haxx.se (8.15.2/8.15.2/Debian-4) with ESMTP id x619N7xB004749;
	Mon, 1 Jul 2019 11:23:31 +0200
Received: from foo.stuge.se (foo.stuge.se [212.116.89.98])
 by giant.haxx.se (8.15.2/8.15.2/Debian-4) with ESMTPS id x619N5Gg004630
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT)
 for <libssh2-devel@cool.haxx.se>; Mon, 1 Jul 2019 11:23:06 +0200
Received: (qmail 12507 invoked by uid 1000); 1 Jul 2019 09:23:01 -0000
Message-ID: <20190701092301.12506.qmail@stuge.se>
Date: Mon, 1 Jul 2019 09:23:01 +0000
From: Peter Stuge <peter@stuge.se>
To: libssh2-devel@cool.haxx.se
Subject: Re: Windows Warnings
References: <62CC3F4B-C737-448F-94BE-BFE7735C6DED@veritas.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <62CC3F4B-C737-448F-94BE-BFE7735C6DED@veritas.com>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <https://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel/>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <https://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
Content-Type: text/plain; charset="utf-8"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: "libssh2-devel" <libssh2-devel-bounces@cool.haxx.se>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id x619N7xB004749

Narayan Subramanian wrote:
> Most of these can be fixed using length trimming bitmasks and other such
> simple transformations.
..
> #define TO32BIT(X)	( (X) & UINT_MAX ) //UINT_MAX is 0xFFFFFFFF
> 
>         rc = libssh2_base64_decode(hosts->session, &ptr, &ptrlen,
>                                    host, TO32BIT(hostlen) );
> 
> I'm sure all warnings can be fixed by simple in - place transformations
> without changing external ABI.  Let me know what you think ...

Please don't send patches to fix the warnings, please send patches to fix
the code. There is a significant difference between the two.

If you merely silence the warning by (now explicitly) truncating the
value then the value continues to be truncated. Whenever that
truncating is actually incorrect you have literally swept the warning
under the rug and have made the real problem much harder to find.


//Peter
_______________________________________________
libssh2-devel https://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Tue Jul  9 09:14:02 2019
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (mail [127.0.0.1])
	by giant.haxx.se (8.15.2/8.15.2/Debian-4) with ESMTP id x697DMFx001709;
	Tue, 9 Jul 2019 09:13:50 +0200
Received: from milliways.cryptomilk.org (milliways.cryptomilk.org
 [78.46.80.163])
 by giant.haxx.se (8.15.2/8.15.2/Debian-4) with ESMTPS id x697DKoq001663
 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT)
 for <libssh2-devel@cool.haxx.se>; Tue, 9 Jul 2019 09:13:21 +0200
Received: from milliways.cryptomilk.org (localhost [127.0.0.1])
 by milliways.cryptomilk.org (Postfix) with ESMTPS id CF3C0E1023
 for <libssh2-devel@cool.haxx.se>; Tue,  9 Jul 2019 09:13:18 +0200 (CEST)
Received: from magrathea.fritz.box (aftr-62-216-200-26.dynamic.mnet-online.de
 [62.216.200.26])
 by milliways.cryptomilk.org (Postfix) with ESMTPSA id 4A34FE0082
 for <libssh2-devel@cool.haxx.se>; Tue,  9 Jul 2019 09:13:18 +0200 (CEST)
From: Andreas Schneider <asn@cryptomilk.org>
To: libssh2-devel@cool.haxx.se
Subject: Update for libssh on the website
Date: Tue, 09 Jul 2019 09:13:17 +0200
Message-ID: <2434550.IxzytNXg3j@magrathea.fritz.box>
MIME-Version: 1.0
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <https://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel/>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <https://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
Content-Type: text/plain; charset="utf-8"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: "libssh2-devel" <libssh2-devel-bounces@cool.haxx.se>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id x697DMFx001709

Hi,

as we've released libssh 0.9.0 I've updated the 'libssh vs libssh' page and 
sent a pull request:

https://github.com/libssh2/www/pull/12

You might want to update it for libssh 1.9.0 after merging it.


Best regards,


	Andreas


-- 
Andreas Schneider                 asn@cryptomilk.org
GPG-ID:     8DFF53E18F2ABC8D8F3C92237EE0FC4DCC014E3D


_______________________________________________
libssh2-devel https://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

