From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.bugs Subject: bug#24494: 24.4; Trailing comma in emacs-module.h Date: Sun, 02 Jul 2017 15:28:55 +0000 Message-ID: References: <87fuotnupa.fsf@wellocc1-ares.jhuapl.edu> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a113d38a09041030553574fec" X-Trace: blaine.gmane.org 1499009422 29161 195.159.176.226 (2 Jul 2017 15:30:22 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 2 Jul 2017 15:30:22 +0000 (UTC) Cc: 24494@debbugs.gnu.org To: Glenn Morris , Christopher Wellons Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jul 02 17:30:15 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1dRgp8-0006ws-6i for geb-bug-gnu-emacs@m.gmane.org; Sun, 02 Jul 2017 17:30:10 +0200 Original-Received: from localhost ([::1]:58373 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dRgpD-0001Ou-Ik for geb-bug-gnu-emacs@m.gmane.org; Sun, 02 Jul 2017 11:30:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44961) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dRgp3-0001MZ-V5 for bug-gnu-emacs@gnu.org; Sun, 02 Jul 2017 11:30:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dRgp0-0002ij-R5 for bug-gnu-emacs@gnu.org; Sun, 02 Jul 2017 11:30:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:46249) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dRgp0-0002ic-Nl for bug-gnu-emacs@gnu.org; Sun, 02 Jul 2017 11:30:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dRgp0-0005iN-Es for bug-gnu-emacs@gnu.org; Sun, 02 Jul 2017 11:30:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Philipp Stephani Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 02 Jul 2017 15:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24494 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch fixed Original-Received: via spool by 24494-submit@debbugs.gnu.org id=B24494.149900935421882 (code B ref 24494); Sun, 02 Jul 2017 15:30:02 +0000 Original-Received: (at 24494) by debbugs.gnu.org; 2 Jul 2017 15:29:14 +0000 Original-Received: from localhost ([127.0.0.1]:48925 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dRgoD-0005gs-Lq for submit@debbugs.gnu.org; Sun, 02 Jul 2017 11:29:13 -0400 Original-Received: from mail-oi0-f49.google.com ([209.85.218.49]:32806) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dRgoB-0005ge-H2 for 24494@debbugs.gnu.org; Sun, 02 Jul 2017 11:29:11 -0400 Original-Received: by mail-oi0-f49.google.com with SMTP id p188so66737417oia.0 for <24494@debbugs.gnu.org>; Sun, 02 Jul 2017 08:29:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JljFlbKQEys+NbKwhuDRTGCmMK68YyNRTAR4shHJ5qo=; b=PdqJXgzvzUW61Yt3K+a94wo9kqo+JbQi9R33Fk26Zh8lpzZz60Z46C91/bF6Xo+LG1 LRwCPOh0a71KrAQ9weH+1kOXV/UOMafQqdKiyAItnVC6XEgNCwQdcFuy8ZjU0rBSxVLY kwOWTGMZjx+AqQzOf995xDr3uAmQ4z98tpeoFao5itqe7l6nFEGbePLA5zafVWamJX6V zAQVXzTOUc8vQPLo8ohbSPSaNbz+NlVpMwrbkjgfY7VxXKeRcI640gmt/WxkDcMIhIdx OaRd4MbiPt8h4wziF/ho0NDNNXCp4+aU8EhILsDL1AYrb/RIpTahO9JXgAtYSrSMfVJ4 5F/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JljFlbKQEys+NbKwhuDRTGCmMK68YyNRTAR4shHJ5qo=; b=tHfeXKeBazsC0CpRHQJg8GDn/JZiLFvBsbbDAwW+k95JNi6PZ2XpmYxrhXOZJZlZQs /Txhts9jSod/gVv5ycziRMA32XFnfriRyqL5RosRpqMZQ7xWrVFJiDJEHLBFMGvJo82d seO6WpKG+LCd1v1mZGwT3TLU6/sOMWI+oFsN9zj/AxihQIUpZ1H/Zl+xDU/hpCTOHQZX LBBsmrM6YcbjamD7n96BPfxKEUGkGwn+kOoRI3c3WUTs/hwgX5+sjxsf5ALxZnj/1xlO TSbCdOcGEFKk6E86Df2KjdnUI6bw1iLGHwvQnWFOl4xP67gu5wcWnzeTZx3PatlzOHSS RJnQ== X-Gm-Message-State: AKS2vOyFt1/47pTa3uDj+j3zakeYxv5OVBJD/8FZCvWdB6Eoa5jV6+aV V3k3d7XG31lMDfFTyL7IzsVU4JxmSw== X-Received: by 10.202.224.70 with SMTP id x67mr15882607oig.75.1499009345665; Sun, 02 Jul 2017 08:29:05 -0700 (PDT) In-Reply-To: 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: 208.118.235.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:134095 Archived-At: --001a113d38a09041030553574fec Content-Type: text/plain; charset="UTF-8" Glenn Morris schrieb am Mo., 12. Dez. 2016 um 23:37 Uhr: > Christopher Wellons wrote: > > > Building Emacs itself now requires a C99 compiler, but this requirement > > needn't extend to dynamic modules. Removing a trailing comma (see patch) > > makes emacs-module.h C89/C90 compatible, allowing modules to be built > > using older C compilers. Trailing commas weren't permitted until C99. > > Thanks for the report. I don't have an opinion, but some comments: > > 1) I think it's going to be hard for developers to remember to use > different conventions for emacs-module.h, so C99-isms are likely to > creep back in. > emacs-module.h is used differently than other parts of the source code, so different conventions apply: It should be more compatible with various compilers, it has to be compatible with C++, all names have to start with "emacs_", it can't depend on any headers not in the standard library, etc. If it's hard to remember these requirements, maybe we should check for them? E.g. add a unit test that including emacs-module.h always works, even with '-pedantic-errors -Weverything -Werror -std=c++98'. Aside: technically emacs-module.h already depends on C99/C++11, via intmax_t and bool. However, these types are apparently often available even in C++98/C89 mode. > > 2) Are people really likely to be building Emacs modules with set-ups > that can't build Emacs itself? > Why not? Modules could be much simpler than Emacs, and module authors might legitimately want to support older compilers. > > 3) It seems this feature was supported by gcc since 0.9? Ie, forever? > https://www.gnu.org/software/gcc/c99status.html > > Hopefully someone who does have an opinion will quickly either fix or > wontfix this issue. :) > I've independently just pushed the same change. I think not breaking pre-C++11 builds (which probably still see signifcant use) is important enough. --001a113d38a09041030553574fec Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


Glenn = Morris <rgm@gnu.org> schrieb am Mo= ., 12. Dez. 2016 um 23:37=C2=A0Uhr:
Christopher Wellons wrote:

> Building Emacs itself now requires a C99 compiler, but this requiremen= t
> needn't extend to dynamic modules. Removing a trailing comma (see = patch)
> makes emacs-module.h C89/C90 compatible, allowing modules to be built<= br> > using older C compilers. Trailing commas weren't permitted until C= 99.

Thanks for the report. I don't have an opinion, but some comments:

1) I think it's going to be hard for developers to remember to use
different conventions for emacs-module.h, so C99-isms are likely to
creep back in.

emacs-module.h is used d= ifferently than other parts of the source code, so different conventions ap= ply: It should be more compatible with various compilers, it has to be comp= atible with C++, all names have to start with "emacs_", it can= 9;t depend on any headers not in the standard library, etc.
If it= 's hard to remember these requirements, maybe we should check for them?= E.g. add a unit test that including emacs-module.h always works, even with= '-pedantic-errors -Weverything -Werror -std=3Dc++98'.
As= ide: technically emacs-module.h already depends on C99/C++11, via intmax_t = and bool. However, these types are apparently often available even in C++98= /C89 mode.
=C2=A0

2) Are people really likely to be building Emacs modules with set-ups
that can't build Emacs itself?

Why = not? Modules could be much simpler than Emacs, and module authors might leg= itimately want to support older compilers.
=C2=A0

3) It seems this feature was supported by gcc since 0.9? Ie, forever?
https://www.gnu.org/software/gcc/c99status.html
Hopefully someone who does have an opinion will quickly either fix or
wontfix this issue. :)

I've independently just pushed the sam= e change. I think not breaking pre-C++11 builds (which probably still see s= ignifcant use) is important enough.
--001a113d38a09041030553574fec--