[all-commits] [llvm/llvm-project] 60f3b0: [clang][analyzer] Add checker for bad use of 'errno'.

Balázs Kéri via All-commits all-commits at lists.llvm.org
Mon Jun 20 01:08:36 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 60f3b071185bf4be32d5c3376856c573975c912a
  Author: Balázs Kéri <1.int32 at gmail.com>
  Date:   2022-06-20 (Mon, 20 Jun 2022)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/docs/analyzer/checkers.rst
    M clang/include/clang/StaticAnalyzer/Checkers/Checkers.td
    M clang/lib/StaticAnalyzer/Checkers/CMakeLists.txt
    A clang/lib/StaticAnalyzer/Checkers/ErrnoChecker.cpp
    M clang/lib/StaticAnalyzer/Checkers/ErrnoModeling.cpp
    M clang/lib/StaticAnalyzer/Checkers/ErrnoModeling.h
    M clang/lib/StaticAnalyzer/Checkers/ErrnoTesterChecker.cpp
    M clang/test/Analysis/analyzer-config.c
    A clang/test/Analysis/errno-notes.c
    A clang/test/Analysis/errno-options.c
    M clang/test/Analysis/errno.c

  Log Message:
  [clang][analyzer] Add checker for bad use of 'errno'.

Extend checker 'ErrnoModeling' with a state of 'errno' to indicate
the importance of the 'errno' value and how it should be used.
Add a new checker 'ErrnoChecker' that observes use of 'errno' and
finds possible wrong uses, based on the "errno state".
The "errno state" should be set (together with value of 'errno')
by other checkers (that perform modeling of the given function)
in the future. Currently only a test function can set this value.
The new checker has no user-observable effect yet.

Reviewed By: martong, steakhal

Differential Revision: https://reviews.llvm.org/D122150

More information about the All-commits mailing list