You might find How to find 56 potential vulnerabilities in FreeBSD code in one evening, PVS-Studio delved into the FreeBSD kernel, and Weaknesses in GCC, Clang and FreeBSD Code interesting reading as well:
* https://www.viva64.com/en/b/0496/ (https://news.ycombinator.com/item?id=14057568)
* https://www.viva64.com/en/b/0377/ (https://news.ycombinator.com/item?id=11131532)
* https://www.viva64.com/en/b/0487/ (https://news.ycombinator.com/item?id=13894115)