From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: Preview: portable dumper Date: Thu, 15 Feb 2018 14:56:07 -0800 Organization: UCLA Computer Science Department Message-ID: References: <6b59d215-ec03-4705-a794-36b54479613e@email.android.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------7F572AD2F1CFCDC56B706C4C" X-Trace: blaine.gmane.org 1518735418 2600 195.159.176.226 (15 Feb 2018 22:56:58 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 15 Feb 2018 22:56:58 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 Cc: emacs-devel@gnu.org To: Daniel Colascione Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Feb 15 23:56:54 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 1emSSM-0008NI-TB for ged-emacs-devel@m.gmane.org; Thu, 15 Feb 2018 23:56:47 +0100 Original-Received: from localhost ([::1]:40469 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emSUP-0000F6-15 for ged-emacs-devel@m.gmane.org; Thu, 15 Feb 2018 17:58:53 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41571) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emSRr-0007LO-6J for emacs-devel@gnu.org; Thu, 15 Feb 2018 17:56:16 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1emSRm-0006x9-7K for emacs-devel@gnu.org; Thu, 15 Feb 2018 17:56:15 -0500 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:46162) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1emSRl-0006wl-SU for emacs-devel@gnu.org; Thu, 15 Feb 2018 17:56:10 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 8509B1616AE; Thu, 15 Feb 2018 14:56:08 -0800 (PST) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id H4BF182FNcTd; Thu, 15 Feb 2018 14:56:07 -0800 (PST) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id A215B1616B1; Thu, 15 Feb 2018 14:56:07 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id rdGST2jYHdcv; Thu, 15 Feb 2018 14:56:07 -0800 (PST) Original-Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 844C41616AE; Thu, 15 Feb 2018 14:56:07 -0800 (PST) In-Reply-To: <6b59d215-ec03-4705-a794-36b54479613e@email.android.com> Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 131.179.128.68 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:222785 Archived-At: This is a multi-part message in MIME format. --------------7F572AD2F1CFCDC56B706C4C Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Here are some problems I ran into on Fedora 27 x86-64. Proposed patch=20 attached. =C2=A0 CC=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pdumper.o In file included from character.h:27:0, =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 from buffer.h:27, =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 from pdumper.c:18: pdumper.c: In function =E2=80=98dump_object_1=E2=80=99: pdumper.c:2920:70: error: left-hand operand of comma expression has no=20 effect [-Werror=3Dunused-value] =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 eassert (("= should not be dumping int: is self-representing",=20 0)); =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ^ lisp.h:195:43: note: in definition of macro =E2=80=98eassert=E2=80=99 =C2=A0# define eassert(cond) ((void) (false && (cond))) /* Check COND=20 compiles.=C2=A0 */ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ^~~~ pdumper.c: In function =E2=80=98dump_vectorlike=E2=80=99: pdumper.c:2823:10: error: this statement may fall through=20 [-Werror=3Dimplicit-fallthrough=3D] =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ((v->header.size & PSEUDOVECTOR_= SIZE_MASK) !=3D FONT_SPEC_MAX && =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ^ pdumper.c:2827:5: note: here =C2=A0=C2=A0=C2=A0=C2=A0 case PVEC_NORMAL_VECTOR: =C2=A0=C2=A0=C2=A0=C2=A0 ^~~~ pdumper.c: At top level: pdumper.c:119:0: error: macro "MAX_OFF_T" is not used=20 [-Werror=3Dunused-macros] =C2=A0# define MAX_OFF_T ((sizeof (off_t) =3D=3D sizeof (int32_t)) ?=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 \ cc1: all warnings being treated as errors make[1]: *** [Makefile:386: pdumper.o] Error 1 make[1]: Leaving directory '/home/eggert/src/gnu/emacs/pdumper/src' make: *** [Makefile:420: src] Error 2 --------------7F572AD2F1CFCDC56B706C4C Content-Type: text/x-patch; name="0001-Pacify-pdumper-for-GCC-7.3.1.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-Pacify-pdumper-for-GCC-7.3.1.patch" >From 990d36af757a3d16b08f438f96431e8d07ae371e Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 15 Feb 2018 14:54:50 -0800 Subject: [PATCH] Pacify pdumper for GCC 7.3.1 * src/pdumper.c (MAX_OFF_T): Remove. (dump_vectorlike): Add FALLTHROUGH. (dump_object_1): Avoid unportable eassert. --- src/pdumper.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/pdumper.c b/src/pdumper.c index 499c8dc27c..9a286c0247 100644 --- a/src/pdumper.c +++ b/src/pdumper.c @@ -115,11 +115,6 @@ verify (sizeof (off_t) == sizeof (int32_t) || sizeof (off_t) == sizeof (int64_t)); verify (CHAR_BIT == 8); -#ifndef MAX_OFF_T -# define MAX_OFF_T ((sizeof (off_t) == sizeof (int32_t)) ? \ - INT32_MAX : INT64_MAX) -#endif - #define DIVIDE_ROUND_UP(x, y) (((x) + (y) - 1) / (y)) static const char dump_magic[16] = { @@ -2823,7 +2818,7 @@ dump_vectorlike (struct dump_context *ctx, const struct Lisp_Vector *v) if ((v->header.size & PSEUDOVECTOR_SIZE_MASK) != FONT_SPEC_MAX && (v->header.size & PSEUDOVECTOR_SIZE_MASK) != FONT_ENTITY_MAX) error_unsupported_dump_object(ctx, lv, "font"); - /* Fall through */ + FALLTHROUGH; case PVEC_NORMAL_VECTOR: case PVEC_COMPILED: case PVEC_CHAR_TABLE: @@ -2917,7 +2912,7 @@ dump_object_1 (struct dump_context *ctx, Lisp_Object object) offset = dump_float (ctx, XFLOAT (object)); break; case_Lisp_Int: - eassert (("should not be dumping int: is self-representing", 0)); + emacs_abort (); default: emacs_abort (); } -- 2.14.3 --------------7F572AD2F1CFCDC56B706C4C--