[neomutt-devel] About C flavour (Was: Refactoring's cosmetics 💄)

Guyzmo z+mutt+neomutt at m0g.net
Wed Jan 25 23:12:24 CET 2017

On Wed, Jan 25, 2017 at 09:46:08PM +0100, Guyzmo wrote:
>  * [C flavour]
>    * flatcap: mutt supports C99 (which isn't too bad), but not C11 there are
>      probably more people out there with C99 compilers than with C11 compilers
>    * clang ≥ 3.0 and GCC ≥ 4.9 have full C11 support, and both are more
>      than 5 years old.

cf the above, I really do think we should upgrade to C11 support. It's
supported by both recent GCC and Clang, and we really don't want to have
to support other compilers.

If a system doesn't support a recent compiler, then it should be
upgraded or replaced.

Also, about switching to "modern" C, that means:

- using #pragma once instead of the ifndef/define/endif dance
- using stdbool.h and stdint.h instead of platform dependant types
- allow one-line commenting with `//` like with C++ (and BCPL and Java)

and there, I'm only talking about C99!

There are a few nice things with C11 as well, like:

- better unicode types (char16_t and char32_t) and uchar.h
- noreturn statement (it'd be nice to add it for the infinite^W FOREVER loops)
- anonymous structs and unions
- new fopen() stuff that's nice for lock files 

it's not as lovely as C99 style, but it's still worth not leaving out.


More information about the neomutt-devel mailing list