On 02/02/2018 11:10 PM, Paul Eggert wrote:
This can cause problems when -fcheck-pointer-bounds is in effect, since converting a pointer to uintptr_t and back means that GCC won't connect the resulting pointer to the original and this messes up bounds checking on the result.
-fcheck-pointer-bounds in GCC doesn't really work. The existing implementation is barely a research prototype (for example, most string functions are not protected by it), and I don't think anyone knows how to make it thread-safe. Its existence shouldn't be used as a guidance for anything, really.
Thanks, Florian