Skip to content

Fix a number of clang-tidy detected defects#22416

Merged
jblomer merged 37 commits into
root-project:masterfrom
jblomer:tidy
Jun 26, 2026
Merged

Fix a number of clang-tidy detected defects#22416
jblomer merged 37 commits into
root-project:masterfrom
jblomer:tidy

Conversation

@jblomer

@jblomer jblomer commented May 28, 2026

Copy link
Copy Markdown
Contributor

A test run of clang-tidy on the RNTuple code with the following checks

Checks: 'bugprone-*,
   -bugprone-assignment-in-if-condition,
   -bugprone-branch-clone,
   -bugprone-derived-method-shadowing-base-method,
   -bugprone-easily-swappable-parameters,
   -bugprone-implicit-widening-of-multiplication-result,
   -bugprone-incorrect-enable-if,
   -bugprone-macro-parentheses,
   -bugprone-multi-level-implicit-pointer-conversion,
   -bugprone-narrowing-conversions,
   -bugprone-not-null-terminated-result,
   -bugprone-random-generator-seed,
   -bugprone-reserved-identifier,
   -bugprone-signed-char-misuse,
   -bugprone-std-namespace-modification,
   -bugprone-switch-missing-default-case,
   -bugprone-throwing-static-initialization,
   -bugprone-too-small-loop-variable,
   -bugprone-unchecked-optional-access,
   -bugprone-unhandled-self-assignment,
   -bugprone-unused-return-value,
   -bugprone-virtual-near-miss,
   cppcoreguidelines-virtual-class-destructor,
   misc-*,
   -misc-non-private-member-variables-in-classes,
   -misc-include-cleaner,
   -misc-misplaced-const,
   -misc-multiple-inheritance,
   -misc-no-recursion,
   -misc-non-private-member-variables-in-classes,
   -misc-predictable-rand,
   -misc-unconventional-assign-operator,
   -misc-use-anonymous-namespace,
   performance-*,
   -performance-enum-size,
   -performance-inefficient-string-concatenation,
   -performance-no-int-to-ptr,
   -performance-noexcept-swap,
   -performance-noexcept-move-constructor,
   readability-duplicate-include,
   readability-delete-null-pointer,
   readability-misleading-indentation,
   readability-redundant-control-flow,
   readability-redundant-declaration,
   readability-redundant-function-ptr-dereference,
   readability-reference-to-constructed-temporary'

@jblomer jblomer self-assigned this May 28, 2026
@jblomer jblomer requested review from dpiparo and pcanal as code owners May 28, 2026 12:14
@github-actions

github-actions Bot commented May 28, 2026

Copy link
Copy Markdown

Test Results

    22 files      22 suites   3d 8h 29m 21s ⏱️
 3 871 tests  3 871 ✅ 0 💤 0 ❌
75 247 runs  75 247 ✅ 0 💤 0 ❌

Results for commit afe3c4e.

♻️ This comment has been updated with latest results.

@dpiparo dpiparo left a comment

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.

Thanks for these changes! Would it be useful to expand this kind of campaigns to other portions of the codebase, e.g. roofit or RDF, or explore other checks?

Comment thread core/foundation/inc/TClassEdit.h

@pcanal pcanal left a comment

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.

LGTM.

@ferdymercury

Copy link
Copy Markdown
Collaborator

Thanks for this, it's great!

Thanks for these changes! Would it be useful to expand this kind of campaigns to other portions of the codebase, e.g. roofit or RDF, or explore other checks?

Yes. Maybe even sth like:
https://github.com/HorstBaerbel/action-clang-tidy
or
https://github.com/marketplace/actions/clang-tidy-review
https://github.com/marketplace/actions/c-c-linter

@hahnjo hahnjo self-requested a review June 4, 2026 11:32
Comment thread core/foundation/inc/ROOT/RError.hxx
Comment thread core/foundation/inc/ROOT/RError.hxx Outdated
Comment thread core/foundation/src/RError.cxx Outdated
@jblomer

jblomer commented Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for this, it's great!

Thanks for these changes! Would it be useful to expand this kind of campaigns to other portions of the codebase, e.g. roofit or RDF, or explore other checks?

Yes. Maybe even sth like: https://github.com/HorstBaerbel/action-clang-tidy or https://github.com/marketplace/actions/clang-tidy-review https://github.com/marketplace/actions/c-c-linter

Maybe. I think the next step would be a regular clang-tidy check for RNTuple as part of the CI. Looking into it.

@jblomer jblomer force-pushed the tidy branch 2 times, most recently from b6666a1 to 45e70d6 Compare June 8, 2026 13:28

@hahnjo hahnjo left a comment

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.

LGTM

Comment thread core/foundation/inc/ROOT/RError.hxx Outdated
Comment thread core/foundation/inc/ROOT/RError.hxx Outdated
@jblomer jblomer added the clean build Ask CI to do non-incremental build on PR label Jun 11, 2026

@silverweed silverweed left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks! I have just a few comments

Comment thread core/foundation/inc/ROOT/RError.hxx
Comment thread tree/ntuple/src/RFieldUtils.cxx
Comment thread tree/ntuple/inc/ROOT/RPage.hxx
Comment thread tree/ntuple/inc/ROOT/RFieldBase.hxx
Comment thread tree/ntuple/inc/ROOT/RFieldBase.hxx Outdated
jblomer added 8 commits June 25, 2026 22:52
A copy constructor of an exception should not throw.
Otherwise, during `throw RException(...)`, a second exception may be thrown
that would immediately terminate the program. The fError member may throw
due to the memory allocation in its string and vector members.
@jblomer jblomer force-pushed the tidy branch 2 times, most recently from 6bdb411 to afe3c4e Compare June 25, 2026 21:07
@jblomer jblomer merged commit 4c3470e into root-project:master Jun 26, 2026
33 of 34 checks passed
@jblomer jblomer deleted the tidy branch June 26, 2026 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clean build Ask CI to do non-incremental build on PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants