https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81801
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target| |32bit target Component|c |target --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Actually it is worse than you think. The problem is __PTRDIFF_TYPE__ is defined incorrectly if pointers can span across the sign bit (32bit). There is whole thread about this on gcc@. The C/C++ language defines ptrdiff_t as a type which can be used two take a difference of any two valid pointers and get a signed difference. In the case here 0x8002000f-0x0001000f should actually return a signed integer that represents the space between those two pointers.