From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alex Newsgroups: gmane.emacs.bugs Subject: bug#34849: Compilation issues with g++ on some files Date: Sat, 16 Mar 2019 23:22:11 -0600 Message-ID: <874l82krcs.fsf@gmail.com> References: <8736nqzdfe.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="85335"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Cc: 34849@debbugs.gnu.org To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Mar 17 06:31:31 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h5OOQ-000M5C-J6 for geb-bug-gnu-emacs@m.gmane.org; Sun, 17 Mar 2019 06:31:30 +0100 Original-Received: from localhost ([127.0.0.1]:50475 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h5OOP-0007Iq-Iv for geb-bug-gnu-emacs@m.gmane.org; Sun, 17 Mar 2019 01:31:29 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:57668) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h5OOG-0007CH-7s for bug-gnu-emacs@gnu.org; Sun, 17 Mar 2019 01:31:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h5OGF-0007e3-5Z for bug-gnu-emacs@gnu.org; Sun, 17 Mar 2019 01:23:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33321) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h5OGE-0007dt-RE for bug-gnu-emacs@gnu.org; Sun, 17 Mar 2019 01:23:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1h5OGE-00074Q-G8 for bug-gnu-emacs@gnu.org; Sun, 17 Mar 2019 01:23:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alex Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 17 Mar 2019 05:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34849 X-GNU-PR-Package: emacs Original-Received: via spool by 34849-submit@debbugs.gnu.org id=B34849.155280017027147 (code B ref 34849); Sun, 17 Mar 2019 05:23:02 +0000 Original-Received: (at 34849) by debbugs.gnu.org; 17 Mar 2019 05:22:50 +0000 Original-Received: from localhost ([127.0.0.1]:46865 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h5OG1-00073n-SK for submit@debbugs.gnu.org; Sun, 17 Mar 2019 01:22:50 -0400 Original-Received: from mail-it1-f173.google.com ([209.85.166.173]:38377) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h5OG0-00073Z-7J for 34849@debbugs.gnu.org; Sun, 17 Mar 2019 01:22:48 -0400 Original-Received: by mail-it1-f173.google.com with SMTP id k193so16768229ita.3 for <34849@debbugs.gnu.org>; Sat, 16 Mar 2019 22:22:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=TIkT9StotC7O6JiYWrBH2Zl0hySx7dxSG8EWq+bIGbg=; b=RqndZTn6/DJUCESREiMAqTDUKYuiQkM9Y91VnkTPxNy2MkvGMIB6rLzoApiPo173N9 hsDQqD6CXaMczEYh5Z0gdQJebZ3fqqmq9qcoTlkiHgN2g7bmOhx3jnPBUmpzv1Gn4KSs FjIZqIUXioeSMWzxFZ40V/zHt62HbgDlO6rpT3TWYJ1v9ZSTQTeiGkXzPgawPCjrOsqA Jsyv3xF0lVzz9bN+HMSz1B2g5bMydElAKd33JYXwzQpxom2vl/xfbPlfzmyy+2UGKBmR vpmQYaC/iZD1ButxoXOWTIjoV5ZbTmd8aKB1CBFk2TKgr/9o4H2r4aHcjYXDkDD/LiOS Ac1A== 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:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=TIkT9StotC7O6JiYWrBH2Zl0hySx7dxSG8EWq+bIGbg=; b=aoqG71hNzKI9CRrYFUBxsmhJDRLdqxzqHHPrgBu9doZUM2Xf+ZmMsxJXkWZlqXJiHI Dqu8cAfTHV48mHiFnf6v9WRP9bb/qXCJwVkqVo9L9JH3wOSQqL+5OmgfA7VxfmpeDhC+ J49Nqs/5Rq6n/WXenTyY7ymS6hbUwhbBDxY0OFAgk6I7erO+Wnj1A4BdZ6cwzxch49Y4 xYJjfeVkzBcZTyS92/KuJCyd/fiNFOaBhRKDGaJDAqRAq9CKIdkcDVOxf/V7ZVytdP5x 7ubNMFCj2TrNWkRpC2ssVkcHHFycUTVdWp/7eCa3vSViTPwaAgLPw1Kgx5vScboRs+Pq qYbA== X-Gm-Message-State: APjAAAWbQv4ySYrSFGgKRbkEl4+oih7efd9Aw7I+Ox66Jj5CPWv2PNin eUz2zFVCDITPpWyTcSYmt2eWBBcZ X-Google-Smtp-Source: APXvYqxLzf6soEp4lxmoNq1mSKxaz2LkraIlTFyiklRRDbmsQA+9+QFVuiXKPV8wWPxrtAzsEJessw== X-Received: by 2002:a24:7b05:: with SMTP id q5mr6701576itc.3.1552800162168; Sat, 16 Mar 2019 22:22:42 -0700 (PDT) Original-Received: from lylat (S010664777d9cebe3.ss.shawcable.net. [70.64.85.59]) by smtp.gmail.com with ESMTPSA id y19sm3442729itb.2.2019.03.16.22.22.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 16 Mar 2019 22:22:41 -0700 (PDT) In-Reply-To: <8736nqzdfe.fsf@gmail.com> (Alex's message of "Wed, 13 Mar 2019 15:12:37 -0600") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:156432 Archived-At: Alex writes: > I'm currently working on a prototype for a feature that requires the > introduction of C++ files, and I am having some issues compiling certain > files with g++. Any chance the below (particularly #3) could be easily > fixed? > > 1. Invalid conversions to pvec_type. Compiling with the -fpermissive > flag demotes these to warnings, but it would be nice to avoid using > that. > > ./src/lisp.h: In function =E2=80=98pvec_type PSEUDOVECTOR_TYPE(const Lisp= _Vector*)=E2=80=99: > ./src/lisp.h:1683:11: error: invalid conversion from =E2=80=98long int=E2= =80=99 to =E2=80=98pvec_type=E2=80=99 [-fpermissive] > return (size & PSEUDOVECTOR_FLAG > ~~~~~~~~~~~~~~~~~~~~~~~~~ > ? (size & PVEC_TYPE_MASK) >> PSEUDOVECTOR_AREA_BITS > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > : PVEC_NORMAL_VECTOR); > ~~~~~~~~~~~~~~~~~~~~~ > ./src/lisp.h: In function =E2=80=98bool PSEUDOVECTORP(Lisp_Object, int)= =E2=80=99: > ./src/lisp.h:1708:6: error: invalid conversion from =E2=80=98int=E2=80=99= to =E2=80=98pvec_type=E2=80=99 [-fpermissive] > code); > ^~~~ > > > 2. This one just needs a new (not new) variable name. > > ./src/lisp.h:1585:58: error: expected =E2=80=98,=E2=80=99 or =E2=80=98...= =E2=80=99 before =E2=80=98new=E2=80=99 > SSET (Lisp_Object string, ptrdiff_t index, unsigned char new) > ^~~ > ./src/lisp.h: In function =E2=80=98void SSET(Lisp_Object, ptrdiff_t, unsi= gned char)=E2=80=99: > ./src/lisp.h:1587:30: error: expected type-specifier before =E2=80=98;=E2= =80=99 token > SDATA (string)[index] =3D new; > ^ > > > 3. I'm not sure what to do for the next one, which is unfortunately > included by other files. > > ./lib/time.h:769:1: error: expected =E2=80=98,=E2=80=99 or =E2=80=98...= =E2=80=99 before =E2=80=98__timer=E2=80=99 > _GL_FUNCDECL_SYS (localtime_rz, struct tm *, > ^~~~~~~~~~~~~~~~ > ./lib/time.h:771:50: error: nonnull argument with out-of-range operand nu= mber (argument 2, operand 3) > struct tm *restrict __result) _GL_ARG_NONNULL ((2, 3)= )); > ^~~~~~~~~~~~~~~ > ./lib/time.h:775:1: error: expected =E2=80=98,=E2=80=99 or =E2=80=98...= =E2=80=99 before =E2=80=98__result=E2=80=99 > _GL_FUNCDECL_SYS (mktime_z, time_t, > ^~~~~~~~~~~~~~~~ I managed to work around #3 by editing lib/time.h.in directly, but now I've hit another issue: compiling lisp.h inside of an extern "C" block. This gets me the following error: --8<---------------cut here---------------start------------->8--- ./lib/verify.h:178:1: error: template with C linkage template --8<---------------cut here---------------end--------------->8--- Paul, do you have any ideas on how to fix this? Is there a solution that works both when __cplusplus is defined and when using C linkage?