Checked C helps programmers avoid common mistakes while dealing with pointers in C. Microsoft's Checked C aims to make software systems more reliable and secure. To do the same, Microsoft has open-sourced Checked C, an extension to the C programming language that adds static and dynamic checking to C.
If you thought Microsoft had stopped loving C, it's time to change your mind. As part of its latest move to improve code quality , Microsoft has made Checked C open source
Checked C is an extension of the C programming language that allows a programmer to write C code that is guaranteed to be checked.
Most system software is written in C or C++ (which is based on C). So, very often system programmers feel the need for a system programming language that can detect and prevent common pointer errors. Checked C provides this functionality and adds an extra level of safety and reliability to the system code.
How can Checked C help in error detection?
In C, pointers are used by programmers to access data. While using them to point to a memory location, it is easy for a programmer to make a mistake, causing the program to read or write the wrong data. Because of these mistakes, programs could crash, misbehave, or be vulnerable to being compromised.
Microsoft explains that Checked C allows programmers to describe the use of pointers in a better way. By using more information, such as the range of memory used, any pointer errors are detected at runtime. This process is called “ bounds-checking.” In the standard C programming language, such errors go unnoticed.
So, just as its name suggests, Checked C adds static and dynamic checking to C.
If you are familiar with the concept of bounds-checking, you may know that languages like C# and Java already have this capability.
However, unlike the automatic addition of information required for check boundaries in these programming, a software system programmer needs to exert more control over the program. Checked C brings this control and makes the code more secure and reliable.
Here you can find the latest version of Checked C. For more information, visit the Microsoft Research page and Checked C GitHub repo

