title: Automatic conversion of stucture to pointer in function call
body: <p>We have a pretty normal looking <code>printf</code> style function in our project, with the modification that the <code>%g</code> format means to print a GUID instead of the normal floating-point type.  For our case, a GUID looks something like this:</p>
  
  <pre><code>struct guid {
    uint32_t  Data1;
    uint16_t  Data2;
    uint16_t  Data3;
    uint8_t   Data4[8];
  };
  </code></pre>
  
  <p>In reality, the print function expects a pointer to the GUID to be passed, as opposed to the structure itself:</p>
  
  <pre><code>struct guid myGuid = { 0x867FD1E7, 0x9AA7, 0x472A, { 0xAA, 0x56, 0xF2, 0xDA, 0x66, 0x62, 0xCD, 0x4D } };
  print("%g", &amp;myGuid);
  </code></pre>
  
  <p>There are several places in the source base, however, where for some reason the entire guid is passed:</p>
  
  <pre><code>print("%g", myGuid);
  </code></pre>
  
  <p>This style of call seems to work fine with MSVC2003 - is there some ABI requirement that makes the compiler translate that function call style to actually pass a pointer behind the scenes?  When porting this codebase to use clang/llvm, it certainly doesn't do the same thing.</p>
  
  <p>Can somebody explain why the second version of the call works with MSVC?  A pointer to the appropriate documentation would be much appreciated!</p>