Skip to content

[9.5] [ML] Fix compiler warnings across the codebase (#2985) - #3145

Open
elastic-vault-github-plugin-prod[bot] wants to merge 1 commit into
9.5from
backport/9.5/pr-2985
Open

[9.5] [ML] Fix compiler warnings across the codebase (#2985)#3145
elastic-vault-github-plugin-prod[bot] wants to merge 1 commit into
9.5from
backport/9.5/pr-2985

Conversation

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

Backport

This will backport the following commits from main to 9.5:

Questions ?

Please refer to the Backport tool documentation

Reduce Clang warnings from ~2500 to 86 (all remaining are
-Wunsafe-buffer-usage which require a std::span migration).

Compiler flag suppressions (clang.cmake):
- -Wno-switch-default: conflicts with the more useful -Wswitch-enum
- -Wno-nrvo: purely informational C++23 diagnostic
- -Wno-missing-noreturn: remaining cases are lambdas where
  [[noreturn]] cannot be applied pre-C++23

Code fixes across 59 files:
- Remove 37 unused const variables (dead code from state
  serialisation refactors)
- Remove 2 unused functions and 2 unused-but-set variables
- Fix 9 shadow warnings by renaming inner variables
- Fix 8 implicit int-to-float conversions with static_cast
- Fix 2 tautological-compare logic bugs where the condition
  !(p >= 0.0 || p <= 1.0) was always false
- Remove 2 redundant default cases in exhaustive enum switches
- Fix 1 pessimizing-move, 1 range-loop-bind-reference,
  1 sign-compare, 1 shorten-64-to-32, 1 CTAD issue
- Remove unnecessary virtual from method in final class
- Add [[noreturn]] to named function throws()
- Add missing newline at EOF

(cherry picked from commit 93c307f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants