C11 will fix C99 errors

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

    Danny Kalev, a former member of the C ++ standardization committee, briefly explains what the main innovations in C11 are about : a new memory model for better support for multithreading, anonymous structures and unions, and many other functions that are already present in C ++.

    Some required 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, writes Kalev. The fact is that C99 was too innovative, it has implemented so many new functions that it is still difficult to find at least one compiler that would support them all.

    The problems arose due to the fact that some of the mandatory features of the C99 were difficult to implement on some platforms. Others were deemed controversial or experimental to the point that some vendors (like Microsoft) went so far as to advise C programmers to switch to C ++ .

    Politics also contributed to the poor perception of C99: it is no secret that the C and C ++ standardization committees did not cooperate enough in the late 90s, to put it mildly. The good news, says Kalev, is that this collaboration is now much better, so the C11 avoided the design mistakes made in the C99.

    Secure programming


    C code security has always been a concern. String processing functions without border checking and file I / O functions without argument checking were a constant source of vulnerabilities for malware.

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

    Additionally, C11 contains Unicode support, complies with IEC 60559 for representing floating point and complex numbers, anonymous structures and joins, data alignment, a function specifier, _Noreturnand most importantly, multithreading support.

    Also popular now: