title: In C, are const variables guaranteed to be distinct in memory?
body: <p>Speaking of string literals, the C99 standard says (6.4.5.6):</p>
  
  <blockquote>
    <p>It is unspecified whether these arrays are distinct provided their elements have the appropriate values. If the program attempts to modify such an array, the behavior is undefined.</p>
  </blockquote>
  
  <p>I couldn't find either a similar warning or an explicit guarantee for const variables. Can the expression <code>&amp;x == &amp;y</code> in the context <code>const int x=12; const int y=12;</code> evaluate to <code>1</code>? What about a const variable and a string literal (i.e. is <code>&amp;x == "\014\000\000"</code> guaranteed to be <code>0</code> even on a 32-bit little-endian platform)?</p>
  
  <p>For what it's worth, the section "String literals" in <a href="http://blog.frama-c.com/index.php?post/2011/06/04/Valid-compare-pointers" rel="noreferrer">this blog post</a> gives the context of the question.</p>