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 zydis not compiling under -Werror #507

Merged
merged 2 commits into from
Jun 2, 2024

Conversation

supernova9sky
Copy link
Contributor

Added an explicit cast in the assert to silence the "-Wsign-compare" error.

Fix not compiling under -Werror
Copy link
Member

@flobernd flobernd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you!

src/Register.c Outdated
ZYAN_ASSERT(reg_class < ZYAN_ARRAY_LENGTH(STATIC_MAPPING));
ZYAN_ASSERT((ZyanU64)reg_class < ZYAN_ARRAY_LENGTH(STATIC_MAPPING));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be a cast to ZyanUSize instead? Otherwise I imagine that it'd still generate a warning in 32 bit builds.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.
It probably should be, because ZyanUSize (which ZYAN_ARRAY_LENGHT returns) and ZyanU64 can differ in size.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, cool -- can you change the PR accordingly, please?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Changed it. Thank you for your time :)

@athre0z athre0z merged commit 5a68f63 into zyantific:master Jun 2, 2024
13 checks passed
@athre0z
Copy link
Member

athre0z commented Jun 2, 2024

Thanks, LGTM now! :)

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.

None yet

3 participants