What is C17 and what changes have been made to the language?

后端 未结 2 1869
误落风尘
误落风尘 2021-01-30 08:32

As I was checking news about GCC 8, I saw that they added support for the 2017 version of the C language (not C++17, really C17). But I can\'t find any information about it on I

2条回答
  •  执念已碎
    2021-01-30 09:01

    C17 is a “bugfix release” of the C standard how "M.S Chaudhari" noticed. However, there is very useful information prepared by Jens Gustedt the author of "Modern C" book.


    He identified the following list of changes in C17 compared to C11:

    • atomics: initialization (7.17.2, 7.31.8), coherence requirements (5.1.2.4), fences (7.17.3 p11), functions or macros (7.17.1 p6), lockfree depends on type (7.17.5 p3), compare exchange compares memory and not value (7.17.7.3), atomic_flag (7.17.18).

    • threads: spurious failures (7.26.3.5 p2, 7.26.3.6 p2, 7.26.4.5 p3), synchronization (7.26.4 p1), thread specific storage (tss_t) and thread exit (7.26.5 p3, 7.26.5.5, 7.26.6)

    • _Generic (6.5.1.1), rvalues and qualification, cast (6.5.4)

    • alignment: fundamental alignment (6.2.8), _Alignas (6.7.5), aligned_alloc (7.22.3.1)

    • sequence points: full expressions (6.8 p4), full declarators (6.7..6 p3)

    • infinite loops (6.8.5 p6)

    • reserved identifiers (7.1.3)

    • domain or range errors (7.12.1), ilogb, erfc, lgamma.

    • underspecification of clock (7.27.2.1)

    • underspecification of realloc for size 0 (7.22.3.5)

    • Annex F: FLT_ROUNDS (F.2 p1)

    • Annex K: tmpnam_s, snprintf_s, sprintf_s, vsprintf_s, get_s, mbstowcs_s, wcstombs_s, snwprintf_s, swprintf_s, vsnwprintf_s, vswprint_s, mbsrtowcs_s, wcsrtombs_s.

    Link to the main page C17.


    Also, this content will be updated by Jens you can follow to update here Jeans Gustedt Blog.

    P.S: before posting all this stuff I received approval from the author.

提交回复
热议问题