title: Can calloc() allocate more than SIZE_MAX in total?
body: <p>In <a href="//codereview.stackexchange.com/a/204977">a recent code review</a>, it was claimed that</p>
  
  <blockquote>
    <p>On select systems, <code>calloc()</code> can allocate more than <code>SIZE_MAX</code> total bytes whereas <code>malloc()</code> is limited.</p>
  </blockquote>
  
  <p>My claim is that that's mistaken, because <code>calloc()</code> creates space for an array of objects - which, being an array, is itself an object.  And no object can be larger in size than <code>SIZE_MAX</code>.</p>
  
  <p>So which of us is correct?  On a (possibly hypothetical) system with address space larger than the range of <code>size_t</code>, is <code>calloc()</code> allowed to succeed when called with arguments whose product is greater than <code>SIZE_MAX</code>?</p>
  
  <p>To make it more concrete: will the following program ever exit with a non-zero status?</p>
  
  <pre><code>#include &lt;stdint.h&gt;
  #include &lt;stdlib.h&gt;
  
  int main()
  {
       return calloc(SIZE_MAX, 2) != NULL;
  }
  </code></pre>