C2x

The C committee (AKA WG14) has now moved to construct the next real revision of the C standard. This is commonly referred to “C2x”, where the “x” is supposed to represent the digit of the year in which this new standard will appear. The whole procedure is ruled by the C2x Charter that describes and fixes what kind of additions and improvements we want to see in C2x.

We regularly publish working drafts that includes the changes that have been added so far. Other than for the C17 process, that was a pure bug fix release, such working papers introduce normative changes and are public and so I will keep up links to the ones that I find relevant, here. The first of these  is still mostly C17, with only a few additions:

The most recent ones can be found here:

I will try to keep a list of changes and their status below. For discussion of all of these and other possible features that you like (or don’t) to be included in C2x, please refer to the appropriate channels. The best is to get involved in the standard’s process by adhering to your national standards body, come to the WG14 meetings and/or subscribing to the committee’s mailing list. Please have in mind that all contributions should be constructive, we aren’t fans of abusive language, insults or denigration.

Comments for this page are switched off. If you have spotted errors or omissions, please contact me directly via mail. Plain mail, please, no twitter or alike, this is your Turing test.


Changes that have been voted for inclusion into C2x

So far, the following changes have been integrated in the latest working paper:

  • DR 476 volatile semantics for lvalues
  • DR 488 c16rtomb on wide characters encoded as multiple char16_t
  • DR 494 Part 1: Alignment specifier expression evaluation
  • DR 497 “white-space character” defined in two places
  • DR 499 Anonymous structure in union behavior
  • DR 500 Ambiguous specification for FLT_EVAL_METHOD
  • N2186 Evaluation formats of floating points
  • N2260 Clarifying the restrict keyword
  • N2265 Harmonizing static_assert with C++
  • N2271 CR for pow divide-by-zero case
  • TS 18661-1 Binary floating-point arithmetic (last working draft N2314)

The following changes have been voted into C2x but have been delayed due to the lack of available work force:

  • TS 18661-2 Decimal floating-point arithmetic (last working draft N2341)
  • N2124 rounding direction macro FE_TONEARESTFROMZERO

The following changes have been voted into C2x with a 6 month period for possible comments or objections and we expect to integrate them after the next meeting (April 2019, London):

  • N2293 Alignment requirements for memory management functions
  • N2302 nextafterl(1.L,2.L)

Some editorial changes that have already been applied

Lists of reserved identifiers

The discussion of the integration of TS 18661-1 has brought to light that there might be
large difference in perception among the committee and the public about the impact of
changes to the document in terms of reserved identifiers. This impact may be important, in
particular if short abbreviated identifiers or common English words are added.
This has lead us to the addition of a new non-normative clause J.6 to Annex 6 (Portability)
that categorizes identifiers used by the document. It consists of a list of 29 regular expressions
that systematically reserve 462 identifiers. Not matched by these regular expressions are 808
identifiers.

Member declarations

The integration of the “C attributes” proposal has pointed us to a set of misnomers of syntax
terms that were particularly annoying, namely four terms that describe different syntax
levels for struct and union members. As historical artifacts these bare all the non-word
“struct” in their names, leading to the confusion that they might actually talk about struct
themselves, and that they would not apply to union.
Thus, we proceeded to a systematic text replacement of the syntax terms “struct declaration”, “struct declaration list” “struct declarator”, and “struct declarator list” to the more
appropriate “member declaration”, “member declaration list”, “member declarator” and
member declarator list”, respectively.

Possible future additions to the C standard

There are many other ideas and documents floating around for inclusion into C2x. The following list is certainly not complete and biased by my personal preferences:

    • Ease the definition of extended integer types, see N2303
    • Add wide or bignum integer types
    • Add type generic interfaces for string functions to the C library, see N2068
    • Add commonly available string functions to the C standard, see N2349, N2351, N2352, andN2353.
    • Add general constants for all data types
    • Extend the concept of integer constant expressions (ICE)
    • Revise atomics and remove ATOMIC_VAR_INIT, see n2329 
    • Revise threads
    • Add attributes, see N2335
    • Revise the memory model, see N2294
    • Remove K&R function declarations and definitions
    • Remove one’s complement and sign-magnitude representations of signed integers, see N2218
    • Remove the * form of VLA function parameter declarations
    • Improve array bound propagation and checks
    • Add a new calling conventions with error return for library functions that avoids the use of errno
    • New string representations for NaNs, see N2290
    • Extend specifications for enum types, see N2008
    • Remove or deprecate Annex K, see N1969
    • Add a type aware print utility with format specification syntax similar to python
    • Add multibyte/wide string conversion functions, see N2282
    • char8_t: A type for UTF-8 characters and strings, see N2231
    • Adding the u8 character prefix, see N2198
    • Harmonizing left-shift behavior with C++, see N2161
    • __has_include for C, see N2101
    • add more TIME_ variants to timespec_get
    • Add wchar_t and FILE to all headers that use them
    • Add a simple specification of nullptr, similar to C++
    • upgrade C library headers with [static 1]
    • type deduction from initializer, similar as C++’s auto
    • constexpr to evaluate expressions at compile time as in C++
    • __VA_ARGS__ comma omission and comma deletion, see N2160
    • TS 18661-3 as annex, see N2342
    • Improved Rules for Tag Compatibility, see N2366
    • Remove support for storage-class specifiers not in first position
    • Remove support for tentative definitions
    • Inline variables
    • Initializers for selection statement
    • auto – type deduction
    •  constexpr variables and functions
    • Allow to not name parameters in function definitions
Advertisements