* bug#24494: 24.4; Trailing comma in emacs-module.h
@ 2016-09-21 15:22 Christopher Wellons
2016-12-12 22:35 ` Glenn Morris
0 siblings, 1 reply; 4+ messages in thread
From: Christopher Wellons @ 2016-09-21 15:22 UTC (permalink / raw
To: 24494
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#24494: 24.4; Trailing comma in emacs-module.h
2016-09-21 15:22 bug#24494: 24.4; Trailing comma in emacs-module.h Christopher Wellons
@ 2016-12-12 22:35 ` Glenn Morris
2017-07-01 20:50 ` npostavs
2017-07-02 15:28 ` Philipp Stephani
0 siblings, 2 replies; 4+ messages in thread
From: Glenn Morris @ 2016-12-12 22:35 UTC (permalink / raw
To: Christopher Wellons; +Cc: 24494
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#24494: 24.4; Trailing comma in emacs-module.h
2016-12-12 22:35 ` Glenn Morris
@ 2017-07-01 20:50 ` npostavs
2017-07-02 15:28 ` Philipp Stephani
1 sibling, 0 replies; 4+ messages in thread
From: npostavs @ 2017-07-01 20:50 UTC (permalink / raw
To: Glenn Morris; +Cc: Christopher Wellons, 24494
tags 24494 fixed
close 24494 26.1
quit
Glenn Morris <rgm@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
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#24494: 24.4; Trailing comma in emacs-module.h
2016-12-12 22:35 ` Glenn Morris
2017-07-01 20:50 ` npostavs
@ 2017-07-02 15:28 ` Philipp Stephani
1 sibling, 0 replies; 4+ messages in thread
From: Philipp Stephani @ 2017-07-02 15:28 UTC (permalink / raw
To: Glenn Morris, Christopher Wellons; +Cc: 24494
[-- Attachment #1: Type: text/plain, Size: 1909 bytes --]
Glenn Morris <rgm@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.
[-- Attachment #2: Type: text/html, Size: 2713 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-07-02 15:28 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-21 15:22 bug#24494: 24.4; Trailing comma in emacs-module.h Christopher Wellons
2016-12-12 22:35 ` Glenn Morris
2017-07-01 20:50 ` npostavs
2017-07-02 15:28 ` Philipp Stephani
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.