Skip to content

Instantly share code, notes, and snippets.

@mirimmad
Last active October 2, 2022 10:12
Show Gist options
  • Save mirimmad/9524fa6ada8dda5436447dcc4cfc86f0 to your computer and use it in GitHub Desktop.
Save mirimmad/9524fa6ada8dda5436447dcc4cfc86f0 to your computer and use it in GitHub Desktop.
GSoC 2022: Extend GCCs static analyzer to support checking for POSIX file descriptor APIs

Google Summer of Code 2022

Overview

The project aims to extend GCC’s static analyzer to support reporting warnings for “misuse” of POSIX FD APIs such as double-close, leakage, access mode mismatch etc. by implementing the state machine that checks such misuse. Also, the project aims to add three attributes for use on functions that work with file descriptors

Progress made

The static analyzer can now recognize functions open, close, read, write, creat, dup, dup2 and dup3 and report their misuse accordingly.

The project added five new warnings to GCC relating to misuse of file descriptors

For more information on above mentioned warnings, refer to the documentation here.

The project also added three new function attribute to the GCC for use on functions that deal with file descriptors:

Documentaion for usage of the new attributes is here

List of commits:

Here is a list of all my commits.

List of bugs solved:

In-progress patches:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment