cast_to_largest_integral_type truncate a 64bit value to 32bit
CoolVenkee opened this issue · comments
CoolVenkee commented
When I try to call will_return with a pointer paremeter on a 64bit linux platform. mock fucntion return another value which losses the high 32bit of the origin value.
int customer_ids = 543; will_return(mock_query_database, &customer_ids);
*results = (void**)mock();
&customer_ids = 0x7ffe38d150cc
but mock() = 0x38d150cc
finally, I modify the source code in cmockery.h, remove ‘unsiged’ in
#define cast_to_largest_integral_type(value) \ ((LargestIntegralType)((unsigned)value))
it works.
chengfen1987 commented
Yes, I have the same issue.