GNU bug report logs - #24494
24.4; Trailing comma in emacs-module.h

Previous Next

Package: emacs;

Reported by: Christopher Wellons <wellons <at> nullprogram.com>

Date: Wed, 21 Sep 2016 15:24:02 UTC

Severity: wishlist

Tags: fixed, patch

Found in version 24.4

Fixed in version 26.1

Done: npostavs <at> users.sourceforge.net

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 24494 in the body.
You can then email your comments to 24494 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#24494; Package emacs. (Wed, 21 Sep 2016 15:24:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Christopher Wellons <wellons <at> nullprogram.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 21 Sep 2016 15:24:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Christopher Wellons <wellons <at> nullprogram.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.4; Trailing comma in emacs-module.h
Date: Wed, 21 Sep 2016 11:22:57 -0400
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.

diff --git a/src/emacs-module.h b/src/emacs-module.h
--- a/src/emacs-module.h
+++ b/src/emacs-module.h
@@ -67,7 +67,7 @@ enum emacs_funcall_exit
   emacs_funcall_exit_signal = 1,

   /* Function has exit using `throw'.  */
-  emacs_funcall_exit_throw = 2,
+  emacs_funcall_exit_throw = 2
 };

 struct emacs_env_25




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24494; Package emacs. (Mon, 12 Dec 2016 22:37:01 GMT) Full text and rfc822 format available.

Message #8 received at 24494 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Christopher Wellons <wellons <at> nullprogram.com>
Cc: 24494 <at> debbugs.gnu.org
Subject: Re: bug#24494: 24.4; Trailing comma in emacs-module.h
Date: Mon, 12 Dec 2016 17:35:53 -0500
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.

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

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. :)


> diff --git a/src/emacs-module.h b/src/emacs-module.h
> --- a/src/emacs-module.h
> +++ b/src/emacs-module.h
> @@ -67,7 +67,7 @@ enum emacs_funcall_exit
>    emacs_funcall_exit_signal = 1,
>
>    /* Function has exit using `throw'.  */
> -  emacs_funcall_exit_throw = 2,
> +  emacs_funcall_exit_throw = 2
>  };
>
>  struct emacs_env_25




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24494; Package emacs. (Sat, 01 Jul 2017 20:50:02 GMT) Full text and rfc822 format available.

Message #11 received at 24494 <at> debbugs.gnu.org (full text, mbox):

From: npostavs <at> users.sourceforge.net
To: Glenn Morris <rgm <at> gnu.org>
Cc: Christopher Wellons <wellons <at> nullprogram.com>, 24494 <at> debbugs.gnu.org
Subject: Re: bug#24494: 24.4; Trailing comma in emacs-module.h
Date: Sat, 01 Jul 2017 16:50:55 -0400
tags 24494 fixed
close 24494 26.1
quit

Glenn Morris <rgm <at> gnu.org> writes:

> 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.
>
> 2) Are people really likely to be building Emacs modules with set-ups
> that can't build Emacs itself?
>
> 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. :)

This has now been done in [1: 0489f2ca5a].

[1: 0489f2ca5a]: 2017-07-01 20:02:24 +0200
  Improve C++98 compatibility
  http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=0489f2ca5a01445d3abb39aea18d54257fedd5f1




Added tag(s) fixed. Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Sat, 01 Jul 2017 20:50:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 26.1, send any further explanations to 24494 <at> debbugs.gnu.org and Christopher Wellons <wellons <at> nullprogram.com> Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Sat, 01 Jul 2017 20:50:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24494; Package emacs. (Sun, 02 Jul 2017 15:30:02 GMT) Full text and rfc822 format available.

Message #18 received at 24494 <at> debbugs.gnu.org (full text, mbox):

From: Philipp Stephani <p.stephani2 <at> gmail.com>
To: Glenn Morris <rgm <at> gnu.org>, Christopher Wellons <wellons <at> nullprogram.com>
Cc: 24494 <at> debbugs.gnu.org
Subject: Re: bug#24494: 24.4; Trailing comma in emacs-module.h
Date: Sun, 02 Jul 2017 15:28:55 +0000
[Message part 1 (text/plain, inline)]
Glenn Morris <rgm <at> gnu.org> 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.
[Message part 2 (text/html, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 31 Jul 2017 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 7 years and 321 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.