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 hal warnings #3199

Closed
wants to merge 6 commits into from
Closed

Fix hal warnings #3199

wants to merge 6 commits into from

Conversation

BsAtHome
Copy link
Contributor

@BsAtHome BsAtHome commented Dec 1, 2024

This PR fixes the warnings about using the volatile modifier. Not all instances of volatile are removed. Volatile is only removed from scalar arguments and return values. All other instances remain as they were because volatile has a defined meaning in those contexts (even though not all may be required). All tests (scripts/runtests) pass (except see #3198).

The PR also addresses the warnings in hal/classicladder about wrong snprintf() size argument and failing to check return values of fgets() and write().

into a pointer by SHMPTR(), which forcefully drops the volatile attribute.
In modern C/C++ a warning is emitted when you declare volatile scalar
arguments or volatile return values. Using volatile in these cases have
always been problematic for what they actually mean and should do.

Note that not all volatile modifiers are removed because many are in
the context of pointer references, where they are important.
@BsAtHome
Copy link
Contributor Author

I will split this PR into smaller pieces. There are several other things I've seen that make no sense. These will be separated into smaller PRs.

@BsAtHome BsAtHome closed this Dec 12, 2024
@BsAtHome BsAtHome deleted the fix_hal_warnings branch January 8, 2025 13:26
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.

1 participant