[pacman-dev] [PATCH] Use C18 language standard

Anatol Pomozov anatol.pomozov at gmail.com
Fri Mar 27 19:52:31 UTC 2020


On Thu, Mar 26, 2020 at 8:47 PM Allan McRae <allan at archlinux.org> wrote:
> On 27/3/20 7:13 am, Anatol Pomozov wrote:
> > C18 is the latest released version of the language spec. The toolchains support
> > it starting with GCC 8.1.0 and Clang 7.
> >
> GCC 8.1.0 - May 2, 2018
> Clang 7 - 19 September 2018
> So available for 18 months.  Seems reasonable given the next release is
> a few months out minimum.
> But why do we need this version?   What feature will be used?  Is C11
> enough?

C18 is mostly a clarification on top of C11 language spec. C18 does
not introduce any new language features

C11 is what was a big step for C language. I use C11 feature in my
other projects and I really like it. Some of my favorite features are:
 - type-generic expressions. This is a poor-man generic that can be
used in macros. Quite useful in some cases for example instead of
having htobe16/htobe32/htobe64/.. this feature allows to have a macro
htobe() with functionality that depends on the parameter type.
 - _Thread_local specifier that allows to introduce a thread-local variables
 - defines for atomic types + functions for accessing the vars in atomic way

More information about the pacman-dev mailing list