s25client icon indicating copy to clipboard operation
s25client copied to clipboard

Fix new clang tidy warnings introduced after clang tidy 10 or keep them disabled

Open ottml opened this issue 9 months ago • 2 comments

See #1771

We have the following new errors with clang-tidy 18:

For now the are disabled. We have decide if we want to fix them or keep them disabled

Some of the errors can be fixed by clang tidy automatically.

[bugprone-assignment-in-if-condition] 19 [bugprone-casting-through-void] 1 [bugprone-empty-catch] 9 [bugprone-optional-value-conversion] 2 [bugprone-reserved-identifier] 47 [bugprone-unchecked-optional-access] 1 [bugprone-unhandled-exception-at-new] 1 [clang-analyzer-core.NonNullParamChecker] 1 [clang-analyzer-cplusplus.NewDeleteLeaks] 1 [clang-analyzer-optin.core.EnumCastOutOfRange] 11 [misc-const-correctness] 1693 [modernize-macro-to-enum] 24 [performance-move-const-arg] 2 [performance-no-int-to-ptr] 6 [readability-avoid-nested-conditional-operator] 66 [readability-avoid-return-with-void-value] 9 [readability-redundant-casting] 15 [readability-suspicious-call-argument] 44 [readability-use-anyofallof] 30

ottml avatar Jun 09 '25 20:06 ottml

  • bugprone-reserved-identifier cannot be fixed (for now)
  • misc-const-correctness can be done automatically, but causes a large change and needs either manual work to switch the generated east-const to west-const or update clang-format to 14+ which supports doing that automatically. We are using version 10 so likely a good idea anyway
  • bugprone-empty-catch might not be reasonable. I guess we could show intention though, e.g. using IgnoreCatchWithKeywords=// Ignore
  • readability-suspicious-call-argument might be useful, but likely needs tuning of its options first to avoid the existing false positives

Flamefire avatar Jun 10 '25 07:06 Flamefire

bugprone-empty-catch might not be reasonable. I guess we could show intention though, e.g. using IgnoreCatchWithKeywords=// Ignore

this one I often have with = @EMPTY - so you need to add a comment to specify why you ignore an exception (we found a few bugs due to missing // TODO: ... ;-)

Flow86 avatar Jun 10 '25 17:06 Flow86