📜 ⬆️ ⬇️

C11 corrects errors C99

In December 2011, the ISO / IEC 9899: 2011 standard was approved, it is also C11 or C1X, a new standard for the C programming language.

Danny Kalev, a former member of the C ++ Standardization Committee, briefly explains the main innovations in C11: a new memory model for better support for multithreading, anonymous structures and associations, and many other features already present in C ++.

Some mandatory C99 functions become optional in C11 (variable length arrays, complex data type, etc.), but some C ++ functions are added. The C and C ++ committees worked closely together to ensure maximum language compatibility.

C11 was adopted 13 years after C99 and should eliminate the problems that appeared with the previous version of the standard, Kalev writes. The fact is that C99 was too innovative, it implemented so many new functions that it is still difficult to find at least one compiler with which to support them all.
')
Problems arose due to the fact that some of the required functions of the C99 proved difficult to implement on some platforms. Others were considered controversial or experimental to such an extent that some vendors (for example, Microsoft) went so far as to advise C programmers to switch to C ++ .

Politics also contributed to the poor perception of C99: it’s no secret that at the end of the 1990s, the C and C ++ Standardization Committees did not cooperate enough, to say the least. The good news, says Kalev, is that this collaboration has now become much better, so the C11 avoided the design mistakes made in the C99.

Safe programming


The security of C code has always been a concern. Boundary-free string checking functions and file I / O functions without argument checking were a constant source of malware vulnerabilities.

C11 solves these problems by introducing a new set of more secure standard functions that should replace past insecure counterparts (although they are still used in C ++).

Additionally, C11 contains Unicode support, conforms to the IEC 60559 standard for representing floating-point numbers and complex numbers, anonymous structures and associations, data alignment, the _Noreturn function _Noreturn and most importantly multi-threading support.

Source: https://habr.com/ru/post/146596/


All Articles