GNU bug report logs -
#24494
24.4; Trailing comma in emacs-module.h
Previous Next
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.
Full log
Message #18 received at 24494 <at> debbugs.gnu.org (full text, mbox):
[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)]
This bug report was last modified 7 years and 322 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.