Skip to content

hal: Update iocontrol to use getter/setter - #4338

Merged
grandixximo merged 1 commit into
LinuxCNC:masterfrom
BsAtHome:halgs_taskclass-iocontrol
Aug 4, 2026
Merged

hal: Update iocontrol to use getter/setter#4338
grandixximo merged 1 commit into
LinuxCNC:masterfrom
BsAtHome:halgs_taskclass-iocontrol

Conversation

@BsAtHome

@BsAtHome BsAtHome commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

This removes the use of hal.hh that accesses HAL's internal structure, which no longer is allowed. The PR does not (yet) remove the hal.hh file, but adds a preprocessor warning when included.
Taskclass/iocontrol was the only place where hal.hh was used and it is easily converted using standard methods and getter/setter(*).

(*) The C++ wrapper hid the type of the pin/param. It is not clear why hiding the HAL types in get/set operations would be an advantage. It only increases complexity in finding out what you are actually using and opens the door to a class of errors of mistaken identity. Or you'd need to start naming your variables to include the type, which then would question why you used the type hiding in the first place.

@grandixximo

Copy link
Copy Markdown
Contributor

This gives way to #4251 if I'm not mistaken?

@BsAtHome

BsAtHome commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

This gives way to #4251 if I'm not mistaken?

Only in part.

Remember, the goal of the getter/setter change is to eliminate the 32-bit types and make everything 64-bit clean. Introducing #4251 now would again make that goal a lot more difficult because the code is currently not clean. Having the C++ wrapper hiding the types is making evaluating where we need to fix 64-bit compatibility a whole lot more difficult (see my comment in the PR description). Remember, we can't just replace 32-bit types with 64-bit types. Every use must be evaluated in context. We need to go through the cleanup steps first.

@grandixximo
grandixximo merged commit 5474573 into LinuxCNC:master Aug 4, 2026
26 of 32 checks passed
@grandixximo

Copy link
Copy Markdown
Contributor

Fair, I will just rebase #4251 cleanup and push, I'll wait on your sign to come out of draft.

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