libcheck / check

A unit testing framework for C
GNU Lesser General Public License v2.1
1.07k stars 210 forks source link

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

Closed brarcher closed 4 years ago

brarcher commented 4 years ago

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.