title: NSLog/printf specifier for NSInteger?
body: <p>A <code>NSInteger</code> is 32 bits on 32-bit platforms, and 64 bits on 64-bit platforms. Is there a <code>NSLog</code> specifier that always matches the size of <code>NSInteger</code>?</p>
  
  <p>Setup</p>
  
  <ul>
  <li>Xcode 3.2.5</li>
  <li>llvm 1.6 compiler <strong>(this is important; gcc doesn't do this)</strong></li>
  <li><code>GCC_WARN_TYPECHECK_CALLS_TO_PRINTF</code> turned on</li>
  </ul>
  
  <p>That's causing me some grief here:</p>
  
  <pre><code>#import &lt;Foundation/Foundation.h&gt;
  
  int main (int argc, const char * argv[]) {
      @autoreleasepool {
          NSInteger i = 0;
          NSLog(@"%d", i);
      }
      return 0;
  }
  </code></pre>
  
  <p>For 32 bit code, I need the <code>%d</code> specifier. But if I use the <code>%d</code> specifier, I get a warning when compiling for 64 bit suggesting I use <code>%ld</code> instead.</p>
  
  <p>If I use <code>%ld</code> to match the 64 bit size, when compiling for 32 bit code I get a warning suggesting I use <code>%d</code> instead.</p>
  
  <p>How do I fix both warnings at once? Is there a specifier I can use that works on either?</p>
  
  <p>This also impacts <code>[NSString stringWithFormat:]</code> and <code>[[NSString alloc] initWithFormat:]</code>.</p>