Anyone want to guess what gcc generates for a==b?0:a-b ? Any ideas why?
OK, you're bringing in something completely separate from the original topic here. If you want to measure distance in address space for some reason related to the address space model, casts to an integer type are the right way because subtracing non-same-array ptrs is undefined.
-
-
The topic of the thread you were replying to was subtracting pointers that are either both pointers into the same array, or both null, and you want the result to be 0 in the latter case.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.