title: Calling NSLog from C++: "Format string is not a string literal (potentially insecure)"
body: <p>When I call NSLog from C++, Xcode complains that the format string passed to NSLog is not a literal string.  Here's a line of code that triggers the warning: </p>
  
  <pre><code>NSLog(CFSTR("Leaking?"));
  </code></pre>
  
  <p>I'm not aware of any way to code a literal NSString in C++, and I don't see a relevant warning I can turn off in the project settings.  Is there a way to call NSLog from C++ without triggering this message?  I'm using Xcode 4.2.1.</p>
  
  <p>Edit:  This really is C++ code.  I usually avoid Objective-C++, sticking to either Objective-C or plain old C++, because there's no official documentation about what works in Objective-C++ and what doesn't.  I've only found vague warnings that (for example) there may be issues with some parts of the STL.  I use templates, the STL, and other "advanced" features of C++, so I want to play it safe.</p>
  
  <p>Edit #2, the solution:  I just figured out clang supports a lot more warning flags than are actually documented.  (It should have been obvious from the long list of warnings that Xcode offered me.)  I tried -Wno-format-nonliteral a la gcc, and now Xcode is happy. </p>