title: Should I use long long or int64_t for portable code?
body: <p>I have an open-source codebase that is written in both C and C++. I'm looking for an integer type that is guaranteed to be <em>at least</em> 64 bits wide, which can be reliably compiled on most OS X (Intel, 64-bit) and Linux boxes with open-source C and C++ compilers, without too much extra work on the end user's part. Windows and 32-bit client support are not important at this time.</p>
  
  <p>I did some testing on OS X, and the latest GCC that ships with the developer tools does not support C+11 mode (and therefore does not seem to guarantee availability of <code>long long</code>). Clang does not support this, either, though it supports <code>long long</code> if C99 mode is enabled, after a certain version.</p>
  
  <p>Is the general suggestion to use <code>int64_t</code> in place of <code>long long</code>, when portability is an important goal? Using the format specifiers seems painful. </p>
  
  <p>Can I reliably cast an <code>int64_t</code> to <code>long long</code> (and likewise to the <code>unsigned</code> equivalent with <code>uint64_t</code>) to use it with existing functions and libraries that take <code>long long</code> as parameters? (And back again, of course.)</p>
  
  <p>In that frame of mind, if I ship code that requires Clang functionality not in GCC, is Clang going to replace GCC as the compiler of choice on Linux? Is that compiler something I can expect, for the most part, when offering source code to end users?</p>
  
  <p>Basically, I'd like to ask for some advice from other developers who have used both types for portable C and C++ code, who might have some suggestions on what might be the better long-term way to go, given the above goal in mind.</p>