Anyone want to guess what gcc generates for a==b?0:a-b ? Any ideas why?
If all existing implementations work this way (null-null==0) it seems like an oversight that it wasn't specified to begin with. BTW a related issue is that relational operators should be defined on null,null (false for <,>; true for <=,>=).
-
-
I wouldn't be sure that all implementations do this. There are still implementations that have several representations for null pointers. Your idea would put the strain of doing a case analysis on all code that does pointer subtraction.
-
I use http://www.unix.org/whitepapers/64bit.html …. (Yes windows is crazy, don't care). Any compiler that breaks (long)a-(long)b is dead to me.
End of conversation
New conversation -
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.