title: Is null pointer dereference undefined behavior in Objective-C?
body: <p>In C and C++, null pointer dereference is undefined behavior. What about Objective-C?</p>
  
  <p>In other words, what is this code guaranteed to do?</p>
  
  <pre><code>*(long*)0 = 0;
  </code></pre>
  
  <p>Background: I wonder if <a href="https://stackoverflow.com/a/13510808/122718">this answer</a> might trigger undefined behavior potentially causing random things like the statement being optimized out or even weirder things.</p>
  
  <p>Of course, I do not endorse doing this. Still, it is important to know the rules of the language.</p>