From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Andy Moreton Newsgroups: gmane.emacs.devel Subject: Re: Preview: portable dumper Date: Mon, 19 Feb 2018 20:03:09 +0000 Message-ID: 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 X-Trace: blaine.gmane.org 1519070564 25717 195.159.176.226 (19 Feb 2018 20:02:44 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 19 Feb 2018 20:02:44 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (windows-nt) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 19 21:02:39 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 1enrdb-0004hE-HC for ged-emacs-devel@m.gmane.org; Mon, 19 Feb 2018 21:02:11 +0100 Original-Received: from localhost ([::1]:52153 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1enrfd-0003wp-JI for ged-emacs-devel@m.gmane.org; Mon, 19 Feb 2018 15:04:17 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40006) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1enrfP-0003wK-De for emacs-devel@gnu.org; Mon, 19 Feb 2018 15:04:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1enrfK-0007lB-8r for emacs-devel@gnu.org; Mon, 19 Feb 2018 15:04:03 -0500 Original-Received: from [195.159.176.226] (port=52659 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1enrfK-0007kw-2x for emacs-devel@gnu.org; Mon, 19 Feb 2018 15:03:58 -0500 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1enrcq-0001ut-I0 for emacs-devel@gnu.org; Mon, 19 Feb 2018 21:01:24 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 42 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:FUbhGIH2vPtYOTkcO68W9/oUed4= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 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:222915 Archived-At: 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. AndyM