aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2010-10-22 22:35:51 +0000
committerFariborz Jahanian <fjahanian@apple.com>2010-10-22 22:35:51 +0000
commitddfa6c38854a4bac67d78e5e21d8a00a4c979573 (patch)
tree5dec20ff90e2c5f734d028a3fb3353b1ff9e6d53
parent38f28c1189142429384996409fffbc57f67b5c60 (diff)
Update compatibility page for objective-c.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117168 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--www/compatibility.html19
1 files changed, 19 insertions, 0 deletions
diff --git a/www/compatibility.html b/www/compatibility.html
index 4196e880ec..bd22f9a8dc 100644
--- a/www/compatibility.html
+++ b/www/compatibility.html
@@ -42,6 +42,7 @@
<li><a href="#super-cast">Cast of super</a></li>
<li><a href="#sizeof-interface">Size of interfaces</a></li>
<li><a href="#objc_objs-cast">Internal Objective-C types</a></li>
+ <li><a href="#c_variables-class">C variables in @class or @protocol</a></li>
</ul>
</li>
<li><a href="#c++">C++ compatibility</a>
@@ -283,6 +284,24 @@ void f(id x);
instead of the internal types.</p>
<!-- ======================================================================= -->
+<h3 id="c_variables-class">C variables in @class or @protocol</h3>
+<!-- ======================================================================= -->
+
+<p>GCC allows declaration of C variables in a @class or @protocol, but not
+C functions. Clang does not allow variable or C function declarations. External
+declarations, however, is allowed. Variables may only be declared in an
+@implementation.
+
+<pre>
+@interface XX
+int x; // not allowed in clang
+int one=1; // not allowed in clang
+extern int OK;
+@end
+
+</pre>
+
+<!-- ======================================================================= -->
<h2 id="c++">C++ compatibility</h3>
<!-- ======================================================================= -->