What's the difference between an integer and a pointer?

(blog.regehr.org)

31 points | by germanrabbit 2 days ago

6 comments

  • glitchc 5 minutes ago
    I don't think GCC is doing something special, rather that -O3 might be optimizing out the subtraction. Try with -O0, I suspect you will get the same result as clang.
  • bryanlarsen 14 minutes ago
    Pointers have provenance, integers don't.
  • pjmlp 41 minutes ago
    2018, and some of the comments are already outdated, SPARK 2014 is out there with ownership model.
  • hn_submit 22 minutes ago
    Context.
  • stronglikedan 5 minutes ago
    well, their names, for starters...
  • spwa4 10 minutes ago
    There is no difference.

    Yes, I'm a C programmer, how did you know?

    • Ohentis 0 minutes ago
      It doesn't sound like you are or you would know C doesn't define either precisely enough to make that statement true.
    • drfloyd51 5 minutes ago
      You should read TFA.