<div dir="ltr">Hi,<div><br></div><div>> This is redundant, given the following two.</div><div><br></div><div>Yeah, that should have been obvious, not sure how I didn't see it.</div><div><br></div><div>> Though notice that in C it is illegal to add a number to a void*, so</div>> this line will raise some warnings. Convert pointers to char* or to<br>> uintptr_t to avoid the warnings.<div><br></div><div>Sorry about that. This is what I have now:</div><div><br></div><div>ok(cur <= ret && (char*)ret < ((char*)ret + 0x100), "Address %p not in function starting at %p.\n", ret, cur);<br></div><div><br></div><div>Is it okay to cast it like this?</div><div><br></div><div>> My interpretation of that page is that calling</div>> __builtin_return_address(0) is always fine, it is for higher frames that<br>> it is not necessarily reliable. Still, it is a GCC-specific thing, so<br>> alternatives should be provided for other compilers.<div><br></div><div>I see, so would it be best to just use the assembly code?</div><div><br></div><div>Regarding the unit test, is it okay to declare the function directly in the test itself? Doing this, the compiler doesn't issue a warning, but it seems suboptimal to me. A header seems like the correct way to go. But I don't know if it's acceptable to write a header file for just 1 function.</div><div><br></div><div>If you or the Wine team thinks a header file is required, should I submit 2 patches instead of one? First for the function implementation and the second for the test, including the header file.</div></div>