title: Size of an integer literal in VC++ and GCC targeting 64-bit machines
body: <p>I'm writing cross-platform x86/x86-64/Itanium code oriented towards high performance and would like to avoid any unnecessary operations, including unneeded type casting.</p>
  
  <p>The code I have calls a function like this:</p>
  
  <pre><code>int theResult = Function(anUInt, 10);
  </code></pre>
  
  <p>Obviously, the type of <code>10</code> value is not specified. And <code>Function</code> is defined like this:</p>
  
  <pre><code>int Function (unsigned int anUInt, int anInt)
  {
      // ...
  }
  </code></pre>
  
  <p>My assumption is that, with VC++ and GCC targeting x86 machines, the size of an integer literal is 4 bytes, so no type casting would need to be performed when assigning <code>10</code> value to <code>anInt</code> parameter while entering the function above (the size of an <code>int</code> value is 4 in almost every data model). Some may not consider it as the ultimate proof of this assumption, but <code>sizeof(1)</code> does return 4 in VC++ and GCC code compiled for the x86 architecture. And I suppose that, if the size of an integer literal on a 64-bit machine was say 8 bytes, the 8 bytes of <code>10</code> value would have to be converted into the 4 bytes of <code>anInt</code> parameter, slowing down performance if <code>Function</code> is called very frequently (which is the case in my program).</p>
  
  <p>So would the size of an integer literal be 4 in VC++ and GCC code compiled for a 64-bit architecture, like x86-64 or Itanium, or would it be 8? In other words, what would <code>sizeof(1)</code> return in VC++ and GCC code targeting 64-bit machines? Any special cases for the Itanium (IA-64) architecture?</p>
  
  <p><em>Edit: changed "untyped integer" to "integer literal".</em></p>