[all-commits] [llvm/llvm-project] dcde8f: [clang-tidy] bugprone-infinite-loop: Fix false pos...

NoQ via All-commits all-commits at lists.llvm.org
Tue Sep 7 15:11:05 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: dcde8fdeeb3ebda6fe6a23d933fbe5caee01c088
      https://github.com/llvm/llvm-project/commit/dcde8fdeeb3ebda6fe6a23d933fbe5caee01c088
  Author: Artem Dergachev <artem.dergachev at gmail.com>
  Date:   2021-09-07 (Tue, 07 Sep 2021)

  Changed paths:
    M clang-tools-extra/clang-tidy/bugprone/InfiniteLoopCheck.cpp
    M clang-tools-extra/test/clang-tidy/checkers/bugprone-infinite-loop.cpp
    M clang-tools-extra/test/clang-tidy/checkers/bugprone-redundant-branch-condition.cpp

  Log Message:
  -----------
  [clang-tidy] bugprone-infinite-loop: Fix false positives with volatile addresses.

Low-level code may occasionally deal with direct access by concrete addresses
such as 0x1234. Values at these addresses act like globals: they can change
at any time. They typically wear volatile qualifiers.

Suppress all warnings on loops with conditions that involve casting anything to
a pointer-to-...-pointer-to-volatile type.

The closely related bugprone-redundant-branch-condition check
doesn't seem to be affected. Add a test just in case.

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




More information about the All-commits mailing list