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 undefined behavior in RV_MARCHID definition #36

Merged
merged 1 commit into from
Jan 8, 2024

Conversation

visitorckw
Copy link
Contributor

The RV_MARCHID macro is defined using a left shift operation without explicitly specifying the type of the constant. This can lead to undefined behavior, specifically a shift too many bits issue.

Modify the RV_MARCHID definition to use the ULL suffix for the constant, ensuring it is treated as an unsigned long long. This eliminates the undefined behavior.

The RV_MARCHID macro is defined using a left shift operation without
explicitly specifying the type of the constant. This can lead to
undefined behavior, specifically a shift too many bits issue.

Modify the RV_MARCHID definition to use the ULL suffix for the
constant, ensuring it is treated as an unsigned long long. This
eliminates the undefined behavior.
@jserv jserv merged commit 41b6f0f into sysprog21:master Jan 8, 2024
2 checks passed
@visitorckw visitorckw deleted the fix-shift-too-many-bits branch January 9, 2024 00:30
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