[all-commits] [llvm/llvm-project] a80c39: [analyzer] Consolidate the va_list checkers (#156682)

Donát Nagy via All-commits all-commits at lists.llvm.org
Mon Sep 8 04:16:46 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a80c393a9c498279a1ec9fd630535b9ff139b49f
      https://github.com/llvm/llvm-project/commit/a80c393a9c498279a1ec9fd630535b9ff139b49f
  Author: Donát Nagy <donat.nagy at ericsson.com>
  Date:   2025-09-08 (Mon, 08 Sep 2025)

  Changed paths:
    M clang/docs/analyzer/checkers.rst
    M clang/include/clang/StaticAnalyzer/Checkers/Checkers.td
    M clang/lib/StaticAnalyzer/Checkers/ValistChecker.cpp
    M clang/test/Analysis/valist-as-lazycompound.c
    M clang/test/Analysis/valist-uninitialized-no-undef.c
    M clang/test/Analysis/valist-uninitialized.c
    M clang/test/Analysis/valist-unterminated.c

  Log Message:
  -----------
  [analyzer] Consolidate the va_list checkers (#156682)

Previously the analyzer had an undocumented top-level checker group
called `valist` which offered several checkers to detect use of
uninitialized `va_list` objects and leaks of `va_list`s.

As the responsibilities of these checkers were messily intertwined and
`va_list` is a rarely used language feature, this commit simplifies the
situation by consolidating these checkers into a single checker which
will be called `security.VAList`.

Note that I'm choosing the capitalization `VAList` to be consistent with
the example of the AST node type `VAArgExpr`. I updated many variable
names to ensure that `ValistChecker.cpp` uses this spelling everywhere
(in CamelCased names). I'm planning to rename `ValistChecker.cpp` to
`VAListChecker.cpp` in a follow-up commit.

This commit also adds documentation for this checker in checkers.rst.

Among the test files I preserved the existing separation but I
eliminated some duplicated cases now that there is no way to separately
enable the old sub-checkers.

For the background of this change see also the discourse thread
https://discourse.llvm.org/t/clean-up-valist-checkers/85277/3



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list