Skip to content

Commit 93adb03

Browse files
committed
More minor documentation tweaks.
llvm-svn: 124791
1 parent 37d30c9 commit 93adb03

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

clang/www/compatibility.html

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -383,19 +383,21 @@ <h3 id="objc_objs-cast">Internal Objective-C types</h3>
383383
instead of the internal types.</p>
384384

385385
<!-- ======================================================================= -->
386-
<h3 id="c_variables-class">C variables in @class or @protocol</h3>
386+
<h3 id="c_variables-class">C variables in @interface or @protocol</h3>
387387
<!-- ======================================================================= -->
388388

389-
<p>GCC allows declaration of C variables in a @class or @protocol, but not
390-
C functions. Clang does not allow variable or C function declarations. External
391-
declarations, however, is allowed. Variables may only be declared in an
392-
@implementation.
389+
<p>GCC allows the declaration of C variables in
390+
an <code>@interface</code> or <code>@protocol</code>
391+
declaration. Clang does not allow variable declarations to appear
392+
within these declarations unless they are marked <code>extern</code>.</p>
393+
394+
<p>Variables may still be declared in an @implementation.</p>
393395

394396
<pre>
395397
@interface XX
396-
int x; // not allowed in clang
397-
int one=1; // not allowed in clang
398-
extern int OK;
398+
int a; // not allowed in clang
399+
int b = 1; // not allowed in clang
400+
extern int c; // allowed
399401
@end
400402

401403
</pre>
@@ -431,7 +433,7 @@ <h3 id="vla">Variable-length arrays</h3>
431433
simple as changing <tt>int size = ...;</tt> to <tt>const int size
432434
= ...;</tt> (if the definition of <tt>size</tt> is a compile-time
433435
integral constant);</li>
434-
<li>use an <tt>std::string</tt> instead of a <tt>char []</tt>;</li>
436+
<li>use <tt>std::string</tt> instead of a <tt>char []</tt>;</li>
435437
<li>use <tt>std::vector</tt> or some other suitable container type;
436438
or</li>
437439
<li>allocate the array on the heap instead using <tt>new Type[]</tt> -

0 commit comments

Comments
 (0)