<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>Le 6 nov. 08 à 16:41, Paolo Bolzoni a écrit :</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Function declarations and variable declarations can have private<br>extern as storage class.<br><br>I sought in the C and C++ standards for 'private extern' but I found nothing.<br>What does private extern mean?<br>When the clang's AST can have private extern in one of its vertices?<br><br>thanks<br>pb<br></div></blockquote><br></div><div>Declaring a symbol as private extern (using the __private_extern__ keyword) is equivalent to declare it using <span class="Apple-style-span" style="font-family: monaco; font-size: 11px; line-height: 11px; white-space: pre; ">__attribute__((visibility("hidden")))</span></div><div><br></div><div><a href="http://developer.apple.com/documentation/DeveloperTools/Conceptual/CppRuntimeEnv/Articles/SymbolVisibility.html">http://developer.apple.com/documentation/DeveloperTools/Conceptual/CppRuntimeEnv/Articles/SymbolVisibility.html</a></div><br><div>and </div><div><br></div><div><a href="http://developer.apple.com/documentation/developertools/conceptual/MachOTopics/Articles/executing_files.html">http://developer.apple.com/documentation/developertools/conceptual/MachOTopics/Articles/executing_files.html</a></div><div><br></div><div><span class="Apple-style-span" style="font-family: 'lucida grande'; ">A <b style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; font-size: 12px; font-weight: bold; ">private external symbol</b> is a defined external symbol that is visible only to other modules within the same object file as the module that contains it. The standard static linker changes private external symbols into private defined symbols unless you specify otherwise (using the <code style="font-size: 11px; font-family: monaco, courier, consolas, monospace; ">-keep_private_externs</code> flag).</span></div><div><span class="Apple-style-span" style="font-family: 'lucida grande'; "><p style="margin-top: 0px; margin-bottom: 10px; font: normal normal normal 12px/normal 'lucida grande', geneva, helvetica, arial, sans-serif; ">You can mark a symbol as private external by using the <code style="font-size: 11px; font-family: monaco, courier, consolas, monospace; ">__private_extern__</code> keyword (which works only in C) or the <code style="font-size: 11px; font-family: monaco, courier, consolas, monospace; ">visibility("hidden")</code>attribute (which works both in C and C++ with GCC 4.0), as in this example:</p><div class="codesample" style="margin-top: 20px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; "><table cellspacing="0" cellpadding="6" width="100%" bgcolor="#F1F5F9" style="border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(201, 209, 215); border-right-color: rgb(201, 209, 215); border-bottom-color: rgb(201, 209, 215); border-left-color: rgb(201, 209, 215); position: static; z-index: auto; "><tbody><tr><td scope="row"><pre style="font-size: 11px; font-family: monaco, courier, consolas, monospace; margin-top: -1px; margin-right: 4px; margin-bottom: -3px; margin-left: 6px; white-space: pre; line-height: 11px; ">__private_extern__ int x = 0;                       // C only<span style="margin-right: 8px; float: right; "></span></pre></td></tr><tr><td scope="row"><pre style="font-size: 11px; font-family: monaco, courier, consolas, monospace; margin-top: -1px; margin-right: 4px; margin-bottom: -3px; margin-left: 6px; white-space: pre; line-height: 11px; ">int y = 99 __attribute__((visibility("hidden")));   // C and C++, GCC 4.0 only</pre></td></tr></tbody></table></div></span></div></body></html>