Skip to content

[config] Add labels for new clang 23 checkers#4821

Open
gamesh411 wants to merge 16 commits intoEricsson:masterfrom
gamesh411:checker-label-update
Open

[config] Add labels for new clang 23 checkers#4821
gamesh411 wants to merge 16 commits intoEricsson:masterfrom
gamesh411:checker-label-update

Conversation

@gamesh411
Copy link
Copy Markdown
Contributor

Add labels for new ClangSA and Clang-Tidy checkers/checks/diagnostics introduced in Clang 23.
Assignments are based on a comparison of result counts across 17 Open-Source projects and follow the conventions already in place.

Add labels for new ClangSA and Clang-Tidy checkers/checks/diagnostics introduced in Clang 23.
Assignments are based on a comparison of result counts across 17 Open-Source projects and follow the conventions already in place.
Copy link
Copy Markdown
Member

@dkrupp dkrupp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a massive change. I made a few comments.
I was not sure wether in the open-source execution the new warnings were enabled or not.

For warnings my logic would be to enable warnings that are enabled by clang by default. If a group of warnings is enabled by default then we should enable all its members by default.

Also cppcheck warnings were not enabled, so it is difficult to see the quality of the checkers to decide about inclusion in the deafault profile.

Comment thread config/labels/analyzers/clang-tidy.json
Comment thread config/labels/analyzers/clang-tidy.json
Comment thread config/labels/analyzers/clang-tidy.json
Comment thread config/labels/analyzers/clang-tidy.json
"doc_url:https://clang.llvm.org/docs/DiagnosticsReference.html#whip-only",
"severity:MEDIUM"
],
"clang-diagnostic-hlsl-explicit-binding": [
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add to default as this warning is enabled by default in clang

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is shader-api related, probably does not hurt.

Comment thread config/labels/analyzers/clang-tidy.json
Comment thread config/labels/analyzers/clang-tidy.json
Comment thread config/labels/analyzers/clang-tidy.json Outdated
Comment thread config/labels/analyzers/clang-tidy.json Outdated
Comment thread config/labels/analyzers/clang-tidy.json Outdated
gamesh411 and others added 14 commits April 29, 2026 10:28
- abseil-unchecked-statusor-access: STYLE → HIGH (unchecked access → UB/crash)
- bugprone-exception-copy-constructor-throws: MEDIUM → HIGH (throw during unwinding → std::terminate)
- bugprone-unsafe-to-allow-exceptions: MEDIUM → HIGH (throw from dtor/move → UB/terminate)
| bugprone-random-generator-seed | sei-cert-c:msc30-c, sei-cert-cpp:msc50-cpp | ⚠️ Questionable | Doc references MSC51-CPP and MSC32-C, not MSC30-C and MSC50-CPP. MSC30-C is about rand()
itself, not seeding. MSC50-CPP is also about rand(). The checker is about seeding, which maps to MSC32-C/MSC51-CPP.
 bugprone-default-operator-new-on-overaligned-type — HIGH severity, very precise (only fires on over-aligned types with default operator new). Should include default.
 bugprone-exception-copy-constructor-throws — HIGH severity (fixed), precise (only fires on exception types with throwing copy ctors). Should include default.
 bugprone-unsafe-to-allow-exceptions — HIGH severity (fixed), precise (only fires on explicit noexcept(false) on dtors/move/swap). Should include default.
| Warning | Enabled by default? | Currently in default profile? | Action needed? |
|---------|---------------------|-------------------------------|----------------|
| -Wenum-compare-typo | ✅ Yes | Yes | ✅ OK |
| -Wgroupshared-initializer | ✅ Yes (error by default) | Yes | ⚠️ But HLSL-specific — should be removed per platform exclusion rule |
| -Whlsl-explicit-binding | ✅ Yes | Yes | ⚠️ HLSL-specific — should be removed per platform exclusion rule |
| -Wimplicit-overflow-behavior-conversion | ❌ No (no "enabled by default" text) | Yes | ❌ Remove |
| -Wimplicit-overflow-behavior-conversion-assignment | ❌ No | Yes | ❌ Remove |
| -Wimplicit-overflow-behavior-conversion-assignment-pedantic | ❌ No | Yes | ❌ Remove |
| -Wimplicit-overflow-behavior-conversion-function-boundary | ❌ No | Yes | ❌ Remove |
| -Wimplicit-overflow-behavior-conversion-function-boundary-pedantic | ❌ No | Yes | ❌ Remove |
| -Wimplicit-overflow-behavior-conversion-pedantic | ❌ No | Yes | ❌ Remove |
| -Wincompatible-pointer-types-discards-overflow-behavior | ✅ Yes | Yes | ✅ OK |
| -Wlifetime-safety-dangling-field | ❌ No (opt-in via -Wlifetime-safety) | Yes | ❌ Remove |
| -Wlifetime-safety-dangling-global | ❌ No | Yes | ❌ Remove |
| -Wlifetime-safety-return-stack-addr | ❌ No | Yes | ❌ Remove |
| -Wlifetime-safety-use-after-scope | ❌ No | Yes | ❌ Remove |
| -Wmatrix-conversion | ✅ Yes | Yes | ✅ OK |

Also: -Wgroupshared-initializer and -Whlsl-explicit-binding are HLSL-specific (non-linux platform), so per the updated profile rules they should be excluded from default/sensitive.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants