Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><code>OBJC_EXTERN</code> is defined in <code>&lt;objc/objc-api.h&gt;</code> as</p> <pre><code>#if !defined(OBJC_EXTERN) # if defined(__cplusplus) # define OBJC_EXTERN extern "C" # else # define OBJC_EXTERN extern # endif #endif </code></pre> <p>and therefore prevents "C++ name mangling" even if the above declaration is included from a C++ source file, as for example explained here:</p> <ul> <li><a href="https://stackoverflow.com/questions/1041866/in-c-source-what-is-the-effect-of-extern-c">In C++ source, what is the effect of extern &quot;C&quot;?</a></li> </ul> <p>For pure C code, you can just remove the <code>OBJC_EXTERN</code>, because the <code>extern</code> keyword is not needed in a function declaration.</p> <hr> <p><code>NS_FORMAT_FUNCTION</code> is defined as </p> <pre><code>#define NS_FORMAT_FUNCTION(F,A) __attribute__((format(__NSString__, F, A))) </code></pre> <p>and <code>__attribute__((format(...)))</code> is a GCC specific extension, also understood by Clang:</p> <ul> <li><a href="http://clang.llvm.org/docs/LanguageExtensions.html#format-string-checking" rel="nofollow noreferrer">http://clang.llvm.org/docs/LanguageExtensions.html#format-string-checking</a></li> <li><a href="http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html" rel="nofollow noreferrer">http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html</a></li> </ul> <p>It allows the compiler to check the number and types of the variable argument list against the format string. For example</p> <pre><code>CLSLog(@"%s", 123); </code></pre> <p>would cause a compiler warning, because <code>%s</code> is the placeholder for a string, but <code>123</code> is an integer.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload