From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Daniel Colascione Newsgroups: gmane.emacs.devel Subject: Re: Preview: portable dumper Date: Mon, 19 Feb 2018 12:16:03 -0800 Message-ID: <40735745-3d04-eef3-fb86-6f53bf52e762@dancol.org> References: <1775923222.898447.1518559575706@mail.libero.it> <277032065.898859.1518560883271@mail.libero.it> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1519071311 8061 195.159.176.226 (19 Feb 2018 20:15:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 19 Feb 2018 20:15:11 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 To: Andy Moreton , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 19 21:15:07 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1enrph-0000En-UI for ged-emacs-devel@m.gmane.org; Mon, 19 Feb 2018 21:14:42 +0100 Original-Received: from localhost ([::1]:52193 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1enrrj-000798-Nn for ged-emacs-devel@m.gmane.org; Mon, 19 Feb 2018 15:16:47 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43701) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1enrrA-00078m-1s for emacs-devel@gnu.org; Mon, 19 Feb 2018 15:16:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1enrr9-00089u-1h for emacs-devel@gnu.org; Mon, 19 Feb 2018 15:16:11 -0500 Original-Received: from dancol.org ([2600:3c01::f03c:91ff:fedf:adf3]:43620) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1enrr8-00089Z-Bh for emacs-devel@gnu.org; Mon, 19 Feb 2018 15:16:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dancol.org; s=x; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:To:Subject; bh=kZLZRlrqlmQ9fYBzxwEF5Q1RvGibT+SwYvHd0H5xj4s=; b=fMvk5d1WI4cA5Tv6QAsBAO3zHSvsLRqSXAfwK5LOJlQpZnV6OX4kS+nEadXqobcSTUEmFXIqcnuOQSO6l4FBE/mBsfgoI/vPerc4OaJQnRbNsA70KMp6Qq33J4VZ1vczGNU41jHw9qXUivpdGV/FCA/8ht2OeT+m3GAveZnpfa3fJw0ftZOZlCa1UmPPJ2u8QSUwWspIj+B57CY5yb4fZd9Zf8rAGVR7hqKGaRiiSyyfsTcsGIjOCCeQoBsUrAExhSvhgnkiWjt+00SeWyII/2wJ0kHI7B1FnL/eIBIhYRPSSSDI1Rd9HSYzVjy7Yy1X1KkxL65UdQe7rwYloR88Yg==; Original-Received: from [2604:4080:1321:8ab0:359b:2963:5873:c169] by dancol.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1enrr7-0001gE-6Q; Mon, 19 Feb 2018 12:16:09 -0800 In-Reply-To: Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2600:3c01::f03c:91ff:fedf:adf3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:223451 On 02/19/2018 12:03 PM, Andy Moreton wrote: > On Mon 19 Feb 2018, Daniel Colascione wrote: > >> On 02/13/2018 02:28 PM, Angelo Graziosi wrote: >>> >>>> Il 13 febbraio 2018 alle 23.06 Angelo Graziosi ha scritto: >>>> >>>> >> >>>> Eli Zaretskii wrote: >>>>> >>>>> I'd urge people to try this branch and report any issues they see. >>>> >>>> What should we look for? >>>> >>> >>> Meanwhile... here the build fails (MSYS2/MinGW64): >>> >>> [...] >>> pdumper.c: In function 'dump_read_all': >>> pdumper.c:4723:45: error: conversion to 'unsigned int' from 'size_t {aka long long unsigned int}' may alter its value [-Werror=conversion] >>> read (fd, (char*) buf + bytes_read, bytes_to_read - bytes_read); >>> ^~~~~~~~~~~~~ >>> CC data.o >>> cc1.exe: some warnings being treated as errors >>> ... >> >> Should be fixed. > > The patch for this in commit b7da1a5af8f1 is not quite right: > > + /* Some platforms accept only int-sized values to read. */ > + unsigned chunk_to_read = UINT_MAX; > + if (bytes_to_read - bytes_read < chunk_to_read) > + chunk_to_read = (unsigned)(bytes_to_read - bytes_read); > > Windows platforms use sys_read from w32.c: > int sys_read(int fd, char *buffer, unsigned int count); > > The limit for a chunk should be INT_MAX (not UINT_MAX) so that it > is representable in the (signed) return value. Is the return value int too? Or is it a ssize_t that can hold UINT_MAX? If the former, agreed.