[tmva] Remove unused LinkDef5.h - #23002
Merged
guitargeek merged 1 commit intoAug 4, 2026
Merged
Conversation
The 2015 split of TMVA into libTMVA and libTMVAGui (5f684bf) dropped the `#include "LinkDef5.h"` line from tmva/tmva/inc/LinkDef.h, but left the file itself in place. It has been unreachable ever since: LinkDef.h includes only LinkDef1.h through LinkDef4.h, no CMakeLists refers to it, and the TMVA dictionary uses the default LINKDEF of LinkDef.h. Every symbol it declares is already declared in tmva/tmvagui/inc/LinkDef.h, which belongs to the module that actually defines those classes, so nothing is lost by removing it. Two later sweeps edited the file without noticing it was dead (eec693f in 2020, e5f5cad in 2024), which is the maintenance cost this removal avoids.
guitargeek
approved these changes
Aug 4, 2026
guitargeek
left a comment
Contributor
There was a problem hiding this comment.
LGTM! Indeed, LinkDef5.h is not referred to anywhere in the source tree.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Removes
tmva/tmva/inc/LinkDef5.h, which has not been part of any dictionary since 2015.Why
The split of TMVA into
libTMVAandlibTMVAGui(5f684bf, 2015-04-28) dropped the#include "LinkDef5.h"line fromtmva/tmva/inc/LinkDef.hbut left the file itself in place.It has been unreachable ever since:
tmva/tmva/inc/LinkDef.hincludes onlyLinkDef1.hthroughLinkDef4.h.CMakeLists.txtor.cmakefile in the repository refers toLinkDef5.h, and the TMVApackage relies on the default
LINKDEFvalue ofLinkDef.h(cmake/modules/RootMacros.cmake:1364).tmva/tmvagui/inc/LinkDef.h, which belongs tothe module that actually defines those classes —
TMVA::MethodInfoandTMVA::StatDialogMVAEffsin
tmva/tmvagui/inc/TMVA/mvaeffs.h,TMVA::StatDialogBDTintmva/tmvagui/inc/TMVA/BDT.h.Comparing the two files,
LinkDef5.hcontains no symbol thattmvagui/inc/LinkDef.hdoes notalready contain, so nothing is lost by removing it.
Two later commits edited the file without noticing it was dead — eec693f (2020, dropping a
tmvaglob.hpragma) and e5f5cad (2024, the__CINT__→__CLING__sweep). That is themaintenance cost this removal avoids.
Verification
Configured a build with the file removed (Ninja,
-DCMAKE_BUILD_TYPE=Release -Dtesting=ON -Droottest=OFF, GCC 13.3 on Ubuntu 24.04). Configuration completes with no errors, and thegenerated
build.ninjacontains:LinkDef5tmva/tmva/inc/LinkDef.htmva/tmvagui/inc/LinkDef.hAll three TMVA dictionaries are still generated:
G__TMVA.cxx,G__TMVAGui.cxx,G__TMVAUtils.cxx.AI-assisted coding disclosure
This contribution was AI-assisted (Claude Code). The tool was used to scan
LinkDeffiles acrossthe repository for entries whose classes are not declared in the module that owns them, and to
draft this description.
The finding was verified before opening the PR rather than taken on trust: the file was confirmed
unreferenced repository-wide, the 2015 commit that removed the include was traced, the symbol sets
of the two
LinkDeffiles were compared, and the configuration check above was run against thebranch with the file already deleted. Three other candidates the same scan produced
(
ROOT::Internal::RDF::CountHelper,MeanHelper,BufferedFillHelper) were false positivescaused by the
R__CLING_PTRCHECK(off)attribute and were discarded rather than reported.I have reviewed and understood the change and take responsibility for it.