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

Resolve warning in ptr macros with pointer to integer cast #284

Merged
merged 1 commit into from
Jun 29, 2020

Conversation

brarcher
Copy link
Contributor

A warning from pointer-to-int-cast is being thrown due to the
_ck_assert_ptr and _ck_assert_ptr_null macros casting a pointer
to an integer value (for printing), but the pointer and integer
sizes are different.

This commit first casts the pointer to a uintptr_t value before
casting it to an unsigned long.

This is the change referenced in #280 and attributed to vtorri.

A warning from pointer-to-int-cast is being thrown due to the
_ck_assert_ptr and _ck_assert_ptr_null macros casting a pointer
to an integer value (for printing), but the pointer and integer
sizes are different.

This commit first casts the pointer to a uintptr_t value before
casting it to an unsigned long.
@brarcher brarcher merged commit aa2c55c into master Jun 29, 2020
@brarcher brarcher deleted the ptr_macros_warning branch June 30, 2020 15:03
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