https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113012
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> --- (In reply to Andrew Pinski from comment #3) > Note I am not shocked that xorg has undefined code in it too. Do you know about any large package which doesn't have any undefined code in it? Anyway, this is definitely UB. Of course, doing that in say uintptr_t rather than in pointer and only cast to pointer when dereferencing could be fine (but then bdos will not track it I think).