Skip to content

emc: cut the nml_intf dependency on tooldata - #4445

Merged
BsAtHome merged 1 commit into
LinuxCNC:masterfrom
grandixximo:nml-tooldata-cut
Aug 22, 2026
Merged

emc: cut the nml_intf dependency on tooldata#4445
BsAtHome merged 1 commit into
LinuxCNC:masterfrom
grandixximo:nml-tooldata-cut

Conversation

@grandixximo

@grandixximo grandixximo commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

emc/nml_intf and emc/tooldata include each other. The reverse edge is one line, emcops.cc:21, held by two calls in EMC_TOOL_STAT.

operator= has no caller: marking it = delete builds the tree in both the default and --enable-toolnml configurations. Its comment claims array members need it, but implicit copy assignment copies those, and the default build has no array member. The copy constructor is already deleted.

The constructor call is a plain initializer for nml_intf's own CANON_TOOL_TABLE, so the default state moves next to the type as CANON_TOOL_TABLE_INIT. Default member initializers would read better, but they make the struct non-POD and clang then rejects tooldata_entry_init(), which is declared extern "C" and returns it by value. The struct itself is untouched, which matters because it lands in the mmapped tool store.

scripts/include-dep-report.py goes from three cycles over nine directories to two over seven.

Part of the dependency work behind #4375.

EMC_TOOL_STAT::operator= has no caller; deleting it builds the tree in
both the default and --enable-toolnml configurations, and its stated
reason, array members, never applied since implicit copy assignment
copies those anyway.

The default state of an entry moves next to the type as
CANON_TOOL_TABLE_INIT, so the constructor no longer borrows
tooldata_entry_init(). Default member initializers would read better but
make the struct non-POD, which clang rejects for tooldata_entry_init(),
declared extern "C" and returning it by value.
@BsAtHome
BsAtHome merged commit 3aadbe0 into LinuxCNC:master Aug 22, 2026
17 checks passed
@grandixximo
grandixximo deleted the nml-tooldata-cut branch August 22, 2026 07:54
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