Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix volatile warnings #3240

Merged
merged 2 commits into from
Dec 30, 2024
Merged

Conversation

BsAtHome
Copy link
Contributor

This fixes all the "inappropriate volatile use" compiler warnings as discussed in #3222. But, it does so in a minimal invasive way.

The use of hal_X_t types in pass-by-value arguments and as value-return types is the actual problem. A passed value in a function argument can never ever be volatile. The same goes for return values. The problem can easily be fixed by using pass-by-reference or using the underlying types of the hal_X_t types.

This PR changes the hal port API slightly, changing hal_port_t pass-by-value to pass-by-reference arguments. The xhc-whb04b-06 component is fixed by using the underlying type, changing hal_float_t to real_t.

None of these changes add or remove functionality in any way. Therefore, it does not matter what type of real-time is used.

…reference.

Do not use hal_port_t as return value type. Instead use a writable reference passed in an argument.
@andypugh andypugh merged commit 41b947a into LinuxCNC:master Dec 30, 2024
10 checks passed
@BsAtHome BsAtHome deleted the fix_volatile-warnings branch January 8, 2025 10:14
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