Microsoft releases C language extension powered by open source
Microsoft has released a new research project called Checked C that is an extension of the existing C language. The new offering emerges as an open source solution to detect and prevent common programming errors.
Unlike developing an all-new language for the developer world, Microsoft Research has modified the original C to offer programmers some new pointer and array types through its Checked C extension. The project itself is written in C and is available under the MIT License.
The availability of new pointer types ensures safety in code. It is aimed at reducing the number of vulnerabilities and puts a stop to the bugs that caused some serious issues like Heartbleed, in the recent past.
“Checked C allows programmers to better describe how they intend to use pointers and the range of memory occupied by data that a pointer points to. This information is then used to add checking at runtime to detect mistakes where the wrong data is accessed, instead of the error occurring silently and without detection. This information can also be used to detect programming errors while the program is being written,” a member of the Microsoft research team wrote in a blog post.
The process of checking is not new and was already debuted on programming languages like C# and Java. But Microsoft’s Checked C stretches this ‘bounds-checking’ by letting developers control the placement of information needed and how the information flows within the code. It helps in providing better control of the program.
Programs that are written in C language need to be converted either file by file or function by function. This enables the detection of errors and offers backward compatibility with existing C developments.
Microsoft has created native Checked C clang and LLVM repositories to provide compiler implementation. The project is additionally accessible through GitHub. However, the project is yet to influence developers in a big way.