title: How are variable arguments implemented in gcc?
body: <pre><code>int max(int n, ...)
  </code></pre>
  
  <p>I am using <code>cdecl</code> calling convention where the caller cleans up the variable after the callee returns. </p>
  
  <p>I am interested in knowing how do the macros <code>va_end</code>, <code>va_start</code> and <code>va_arg</code> work?</p>
  
  <p>Does the caller pass in the address of the array of arguments as the second argument to max?</p>