Contributor
Eric Feng

GCC static analyzer plugin for CPython extension modules


Mentors
David Malcolm
Organization
GNU Compiler Collection (GCC)
Technologies
c++, gcc, CPYTHON
Topics
compilers, programming languages, Static analysis
One pertinent use case of the gcc-python plugin was to provide the infrastructure for cpychecker, a static analysis tool designed for CPython extension modules. The primary objective of cpychecker was to assist programmers in identifying common coding errors in their extensions, which, in turn, could lead to difficult-to-find bugs in their systems. However, the gcc-python-plugin has suffered from bitrot over the years, and as a result, cpychecker ceased functioning several GCC releases ago. The goal of this project is to port the functionalities of cpychecker to a -fanalyzer plugin, offering programmers a reliable tool for conducting static analysis of CPython extension modules once again in a more maintainable manner. The project will be divided into several logical components, such as reference count checking, format string checking, error handling checking, and verification of PyMethodDef tables. Accomplishing this task will involve building a -fanalyzer plugin and extending certain areas of the existing analyzer.