From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.ciao.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.devel Subject: Re: Compiling pdumper.c fails with gcc 4.7.2 Date: Wed, 23 Jan 2019 14:48:12 +0100 Message-ID: References: <5C482F7E.1050805@gmx.at> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.org; posting-host="ciao.gmane.org:195.159.176.228"; logging-data="22918"; mail-complaints-to="usenet@ciao.gmane.org" Cc: emacs-devel To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 23 14:55:52 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gmJ0Q-0005og-8h for ged-emacs-devel@m.gmane.org; Wed, 23 Jan 2019 14:55:50 +0100 Original-Received: from localhost ([127.0.0.1]:34968 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gmJ0O-0002b5-WD for ged-emacs-devel@m.gmane.org; Wed, 23 Jan 2019 08:55:49 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:58680) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gmIva-00074G-BW for emacs-devel@gnu.org; Wed, 23 Jan 2019 08:50:51 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gmIt6-00012t-FQ for emacs-devel@gnu.org; Wed, 23 Jan 2019 08:48:17 -0500 Original-Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:39188) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gmIt6-00012M-9d for emacs-devel@gnu.org; Wed, 23 Jan 2019 08:48:16 -0500 Original-Received: by mail-wm1-x334.google.com with SMTP id y8so1991730wmi.4 for ; Wed, 23 Jan 2019 05:48:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:mail-followup-to:mail-copies-to :gmane-reply-to-list:date:message-id:mime-version :content-transfer-encoding; bh=hrghVOi2bbvvx/pXHplesj2N7ZiZieB5Nh/I1eK/rYs=; b=s+60uT6Z26DqMjSXi5ukaaiIkFVjx3RwDkF3ihnttaiQrceWFkKRA4WGtxdlUqUYjJ N6om/rAJxkJ2HU5JUgYWDjv7YsHJiHR16gTpR00+dONGQoNrJTLEHut+zW1xQojr/JnH /Os8KlQ75iEyOZ4wbfl+9Dzey9fbhX6s7/xK6qELCJNXcLR646K8ejSuDJz4qEVJc1Nq LkpZwvhR2SI0UNJjUW3ZTwNwr0SBaFqPi+b01LMvQc1BIqCXZEtRJfT9Bbrvscoyqu+7 CeQP66UbAGgC56PkvLUpHRySOzzL2mWuZgMUAM9OfeWw4URLEFsSMVn5lIR/ZgtQ9EMw anMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:mail-followup-to :mail-copies-to:gmane-reply-to-list:date:message-id:mime-version :content-transfer-encoding; bh=hrghVOi2bbvvx/pXHplesj2N7ZiZieB5Nh/I1eK/rYs=; b=BREJ0hfxYL+Pmck2I74m359J1KbSwGcsAAe5dmBCho61LaTFgh8lJ2iU6RbVtPGaZy NAbzr7sn53SNNUsmKyPZPTijbSuTi1xIXqDlkuEJCjUQquu1b2KkpZrrC0ytAc5CmrRI 7KvayXxXwPuryySeYn3pm7bIGapWQB9u8Uss1vuo8id2SitdJ1dMKCW9daHtfNEJ00zA mPZfsbTvO+MTZYa7U/a1egodrGr09vU47FZQZZdsjyvNuSn7Gr47BKeL1MaBA821ab5u ayWa8h/YvUUCfgS2C0hzwyBqUvGKrI34FZQssTnpokt13XW1xQUD3BztgMFUhEjcm4AW Firw== X-Gm-Message-State: AJcUukfeIPr7G7G3KwfHifjaOHxwsQcipbyXNZwBPk5JSHrIO+4RwTVP n587S4u2poZfhQ/So55IO8m6Z6fZ X-Google-Smtp-Source: ALg8bN6IFCVfEW87Y6rjesHuyl82PNOvQis4Jo1BHlh9fdcdIkHU7p37rqfIqY9of9V8ZHUrIPMo3w== X-Received: by 2002:a1c:be11:: with SMTP id o17mr2743731wmf.111.1548251294467; Wed, 23 Jan 2019 05:48:14 -0800 (PST) Original-Received: from rpluim-mac ([149.5.228.1]) by smtp.gmail.com with ESMTPSA id x3sm94523969wrd.19.2019.01.23.05.48.13 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 23 Jan 2019 05:48:13 -0800 (PST) Mail-Followup-To: emacs-devel@gnu.org Mail-Copies-To: never Gmane-Reply-To-List: yes X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::334 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:232627 Archived-At: martin rudalics writes: > With gcc 4.7.2 compiling pdumper.c fails thusly: > > CC pdumper.o > ../../src/pdumper.c: In function =E2=80=98emacs_offset=E2=80=99: > ../../src/pdumper.c:718:27: error: declaration of =E2=80=98emacs_ptr=E2= =80=99 shadows a global declaration [-Werror=3Dshadow] > ../../src/pdumper.c:710:1: error: shadowed declaration is here [-Werror= =3Dshadow] > > Is there any practicable way to fix this? Sure, the emacs_ptr function is static, so it can change name easily enough. Something like the following works for me: diff --git i/src/pdumper.c w/src/pdumper.c index 6be26dc816..c79034df79 100644 --- i/src/pdumper.c +++ w/src/pdumper.c @@ -707,7 +707,7 @@ emacs_basis (void) } =20 static void * -emacs_ptr (const ptrdiff_t offset) +offset_to_emacs_ptr (const ptrdiff_t offset) { /* TODO: assert somehow that the result is actually in the Emacs image. */ @@ -5330,24 +5330,24 @@ dump_do_emacs_relocation ( { case RELOC_EMACS_COPY_FROM_DUMP: eassume (reloc.length > 0); - memcpy (emacs_ptr (reloc.emacs_offset), + memcpy (offset_to_emacs_ptr (reloc.emacs_offset), dump_ptr (dump_base, reloc.u.dump_offset), reloc.length); break; case RELOC_EMACS_IMMEDIATE: eassume (reloc.length > 0); eassume (reloc.length <=3D sizeof (reloc.u.immediate)); - memcpy (emacs_ptr (reloc.emacs_offset), + memcpy (offset_to_emacs_ptr (reloc.emacs_offset), &reloc.u.immediate, reloc.length); break; case RELOC_EMACS_DUMP_PTR_RAW: pval =3D reloc.u.dump_offset + dump_base; - memcpy (emacs_ptr (reloc.emacs_offset), &pval, sizeof (pval)); + memcpy (offset_to_emacs_ptr (reloc.emacs_offset), &pval, sizeof (pva= l)); break; case RELOC_EMACS_EMACS_PTR_RAW: pval =3D reloc.u.emacs_offset2 + emacs_basis (); - memcpy (emacs_ptr (reloc.emacs_offset), &pval, sizeof (pval)); + memcpy (offset_to_emacs_ptr (reloc.emacs_offset), &pval, sizeof (pva= l)); break; case RELOC_EMACS_DUMP_LV: case RELOC_EMACS_EMACS_LV: @@ -5356,12 +5356,12 @@ dump_do_emacs_relocation ( eassume (reloc.length <=3D Lisp_Float); void *obj_ptr =3D reloc.type =3D=3D RELOC_EMACS_DUMP_LV ? dump_ptr (dump_base, reloc.u.dump_offset) - : emacs_ptr (reloc.u.emacs_offset2); + : offset_to_emacs_ptr (reloc.u.emacs_offset2); if (reloc.length =3D=3D Lisp_Symbol) lv =3D make_lisp_symbol (obj_ptr); else lv =3D make_lisp_ptr (obj_ptr, reloc.length); - memcpy (emacs_ptr (reloc.emacs_offset), &lv, sizeof (lv)); + memcpy (offset_to_emacs_ptr (reloc.emacs_offset), &lv, sizeof (lv)= ); break; } default: