Hacker News new | ask | show | jobs
by notorandit 10 days ago
Assembly programmer here.

Depending upon the architecture, not all values can be memory addresses (aka pointers) due to alignment constraints. Then other way around is possible as long as memory addresses have at least l the same number of bits as integers.

Finally, as long as you don't dereference an integer used (casted) as a pointer, there is no difference. Like equality comparison.

1 comments

Assembly indeed has a very easy exit in such issues (and in UB in general).