title: "Integer operation result out of range" in cuda source code
body: <p>I'm trying to compile a code written using CUDA 3.2 on RHEL 5.6. The relevant portions are </p>
  
  <pre><code>extern "C"{
  #include &lt;stdio.h&gt;
  #include &lt;inttypes.h&gt;
  static uint64_t size = 0;
  ...
  size = 5000 * 1024 * 1024;
  printf("sizeof(size) = %d size = %lu\n", sizeof(size), size);
  }
  </code></pre>
  
  <p>The code is in a .cu file, and compiled using nvcc. I get the compilation warning that for the line "size = 5000 * 1024 * 1024", the "integer operation result is out of range". The output I got is</p>
  
  <pre><code>sizeof(size) = 8 size = 947912704
  </code></pre>
  
  <p>I don't understand why the variable "size" can't represent the value 5242880000 if it's 8-bytes large.</p>
  
  <p>Thank you.</p>