[clang-tools-extra] [clang-tidy] Stop ignoring `-std` argument in `check_clang_tidy.py` for C files (PR #150791)

Baranov Victor via cfe-commits cfe-commits at lists.llvm.org
Sat Jul 26 13:33:09 PDT 2025


================
@@ -5,14 +5,14 @@
 // parsing and preprocessor state will not have that case.
 // UNSUPPORTED: target={{.*-(ps4|ps5)}}
 //
-// RUN: %check_clang_tidy -check-suffix=WITH-ANNEX-K            %s bugprone-unsafe-functions %t -- -- -D__STDC_LIB_EXT1__=1 -D__STDC_WANT_LIB_EXT1__=1
-// RUN: %check_clang_tidy -check-suffix=WITHOUT-ANNEX-K         %s bugprone-unsafe-functions %t -- -- -U__STDC_LIB_EXT1__   -U__STDC_WANT_LIB_EXT1__
-// RUN: %check_clang_tidy -check-suffix=WITHOUT-ANNEX-K         %s bugprone-unsafe-functions %t -- -- -D__STDC_LIB_EXT1__=1 -U__STDC_WANT_LIB_EXT1__
-// RUN: %check_clang_tidy -check-suffix=WITHOUT-ANNEX-K         %s bugprone-unsafe-functions %t -- -- -U__STDC_LIB_EXT1__   -D__STDC_WANT_LIB_EXT1__=1
-// RUN: %check_clang_tidy -check-suffix=WITH-ANNEX-K-CERT-ONLY  %s bugprone-unsafe-functions %t -- \
+// RUN: %check_clang_tidy -std=c11-or-later -check-suffix=WITH-ANNEX-K            %s bugprone-unsafe-functions %t -- -- -D__STDC_LIB_EXT1__=1 -D__STDC_WANT_LIB_EXT1__=1
----------------
vbvictor wrote:

Do we need to add `-std` here? I'd suggest to make a separate PR with this changes after current lands.
Here you added `-std` but in `misc/unused-parameters.c` don't.
I'd suggest keeping this PR as small as possible with functional changes and the create a NFC.

https://github.com/llvm/llvm-project/pull/150791


More information about the cfe-commits mailing list