[all-commits] [llvm/llvm-project] 230b9b: [clang-tidy] Add `-std` argument in `check_clang_t...

Victor Chernyakin via All-commits all-commits at lists.llvm.org
Sat Aug 23 02:34:53 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 230b9b2026116766d6fdedb499cc8a1e78b647e5
      https://github.com/llvm/llvm-project/commit/230b9b2026116766d6fdedb499cc8a1e78b647e5
  Author: Victor Chernyakin <chernyakin.victor.j at outlook.com>
  Date:   2025-08-23 (Sat, 23 Aug 2025)

  Changed paths:
    M clang-tools-extra/docs/ReleaseNotes.rst
    M clang-tools-extra/test/clang-tidy/check_clang_tidy.py
    M clang-tools-extra/test/clang-tidy/checkers/Inputs/Headers/system-other.h
    M clang-tools-extra/test/clang-tidy/checkers/android/comparison-in-temp-failure-retry-custom-macro.c
    M clang-tools-extra/test/clang-tidy/checkers/android/comparison-in-temp-failure-retry.c
    M clang-tools-extra/test/clang-tidy/checkers/bugprone/branch-clone-macro-crash.c
    M clang-tools-extra/test/clang-tidy/checkers/bugprone/easily-swappable-parameters-relatedness.c
    M clang-tools-extra/test/clang-tidy/checkers/bugprone/easily-swappable-parameters.c
    M clang-tools-extra/test/clang-tidy/checkers/bugprone/not-null-terminated-result-in-initialization-strlen.c
    M clang-tools-extra/test/clang-tidy/checkers/bugprone/not-null-terminated-result-memcpy-before-safe.c
    M clang-tools-extra/test/clang-tidy/checkers/bugprone/not-null-terminated-result-memcpy-safe.c
    M clang-tools-extra/test/clang-tidy/checkers/bugprone/not-null-terminated-result-stdc-want-lib-ext1-not-a-literal.c
    M clang-tools-extra/test/clang-tidy/checkers/bugprone/not-null-terminated-result-strlen.c
    M clang-tools-extra/test/clang-tidy/checkers/bugprone/not-null-terminated-result-undef-stdc-want-lib-ext1.c
    M clang-tools-extra/test/clang-tidy/checkers/bugprone/signal-handler.c
    M clang-tools-extra/test/clang-tidy/checkers/bugprone/signed-char-misuse-c23.c
    M clang-tools-extra/test/clang-tidy/checkers/bugprone/sizeof-expression.c
    M clang-tools-extra/test/clang-tidy/checkers/bugprone/unsafe-functions.c
    M clang-tools-extra/test/clang-tidy/checkers/google/objc-function-naming.m
    M clang-tools-extra/test/clang-tidy/checkers/misc/static-assert.c
    M clang-tools-extra/test/clang-tidy/checkers/misc/unused-parameters.c
    M clang-tools-extra/test/clang-tidy/checkers/modernize/use-nullptr-c23.c
    M clang-tools-extra/test/clang-tidy/checkers/readability/bitint-no-crash.c
    M clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-standard-types.h
    M clang-tools-extra/test/clang-tidy/checkers/readability/implicit-bool-conversion.c
    M clang-tools-extra/test/clang-tidy/checkers/readability/non-const-parameter.c

  Log Message:
  -----------
  [clang-tidy] Add `-std` argument in `check_clang_tidy.py` for C files (#150791)

Before, the `-std` argument in C tests was simply ignored, and they were
run with whatever Clang defaults to when you don't specify a standard.
The new default is `-std=c99-or-later`. This means a bunch of tests are
suddenly being run in C23 mode, and so need to be adapted to account for
various things:

- `typeof` is changed to `__typeof__`; the non-`__ugly__` spelling is
only available with GNU extensions or C23.
- In C23, `bool` is a keyword, so `typedef foo bool;` is invalid.
- In C23, `f()` means `f(void)`, not "takes arbitrary parameters".
- In C23, K&R-style function definitions are removed.



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