From 3cdbe44e0d0363a2c42c516c8e1f58e07999fab3 Mon Sep 17 00:00:00 2001
From: John McCall
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. +
GCC allows the declaration of C variables in
+an @interface
or @protocol
+declaration. Clang does not allow variable declarations to appear
+within these declarations unless they are marked extern
.
Variables may still be declared in an @implementation.
@interface XX -int x; // not allowed in clang -int one=1; // not allowed in clang -extern int OK; +int a; // not allowed in clang +int b = 1; // not allowed in clang +extern int c; // allowed @end@@ -431,7 +433,7 @@ template parameter. simple as changing int size = ...; to const int size = ...; (if the definition of size is a compile-time integral constant); -