upgrade various 'implicit int' warnings from an ext-warn to warning when not
in C89 mode. This makes it enabled by default instead of only enabled with
-pedantic. Clang defaults to c99 mode, so people will see this more often
than with GCC, but they can always use -std=c89 if they really want c89.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65647 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Parser/MicrosoftExtensions.c b/test/Parser/MicrosoftExtensions.c
index 27283de..039bafe 100644
--- a/test/Parser/MicrosoftExtensions.c
+++ b/test/Parser/MicrosoftExtensions.c
@@ -11,7 +11,7 @@
{
return((void * __ptr64) (unsigned __int64) (ULONG_PTR)p );
}
-__forceinline InterlockedBitTestAndSet (long *Base, long Bit)
+__forceinline InterlockedBitTestAndSet (long *Base, long Bit) // expected-warning {{type specifier missing, defaults to 'int'}}
{
__asm {
mov eax, Bit
diff --git a/test/Parser/objc-forcollection-neg-2.m b/test/Parser/objc-forcollection-neg-2.m
index 308db05..31c8097 100644
--- a/test/Parser/objc-forcollection-neg-2.m
+++ b/test/Parser/objc-forcollection-neg-2.m
@@ -24,7 +24,7 @@
@implementation MyList (BasicTest)
- (void)compilerTestAgainst {
- static i;
+ static i;// expected-warning {{type specifier missing, defaults to 'int'}}
for (id el, elem in self) // expected-error {{only one element declaration is allowed}}
++i;
for (id el in self)
diff --git a/test/Parser/traditional_arg_scope.c b/test/Parser/traditional_arg_scope.c
index e1b0256..f89708c 100644
--- a/test/Parser/traditional_arg_scope.c
+++ b/test/Parser/traditional_arg_scope.c
@@ -1,7 +1,7 @@
// RUN: clang -fsyntax-only %s -verify
-x(a) int a; {return a;}
-y(b) int b; {return a;} // expected-error {{use of undeclared identifier}}
+int x(a) int a; {return a;}
+int y(b) int b; {return a;} // expected-error {{use of undeclared identifier}}
// PR2332
-a(a)int a;{a=10;return a;}
+int a(a)int a;{a=10;return a;}
diff --git a/test/Parser/typeof.c b/test/Parser/typeof.c
index 1cf04ba..ac51f58 100644
--- a/test/Parser/typeof.c
+++ b/test/Parser/typeof.c
@@ -11,7 +11,7 @@
typeof(TInt) anInt;
short TInt eee; // expected-error{{parse error}}
void ary[7] fff; // expected-error{{array has incomplete element type 'void'}} expected-error{{parse error}}
- typeof(void ary[7]) anIntError; // expected-error{{expected ')'}} expected-note {{to match this '('}}
+ typeof(void ary[7]) anIntError; // expected-error{{expected ')'}} expected-note {{to match this '('}} expected-warning {{type specifier missing, defaults to 'int'}}
typeof(const int) aci;
const typeof (*pi) aConstInt;
int xx;
diff --git a/test/Sema/address_spaces.c b/test/Sema/address_spaces.c
index 8900b08..a081b38 100644
--- a/test/Sema/address_spaces.c
+++ b/test/Sema/address_spaces.c
@@ -5,7 +5,7 @@
#define _AS3 __attribute__((address_space(3)))
void foo(_AS3 float *a) {
- _AS2 *x;
+ _AS2 *x;// expected-warning {{type specifier missing, defaults to 'int'}}
_AS1 float * _AS2 *B;
int _AS1 _AS2 *Y; // expected-error {{multiple address spaces specified for type}}
diff --git a/test/Sema/block-literal.c b/test/Sema/block-literal.c
index d5d41ab..7f64c03 100644
--- a/test/Sema/block-literal.c
+++ b/test/Sema/block-literal.c
@@ -40,7 +40,7 @@
foo:
takeclosure(^{ x = 4; }); // expected-error {{variable is not assignable (missing __block type specifier)}}
- __block y = 7;
+ __block y = 7; // expected-warning {{type specifier missing, defaults to 'int'}}
takeclosure(^{ y = 8; });
}
diff --git a/test/Sema/implicit-int.c b/test/Sema/implicit-int.c
index e4a215f..f15a40f 100644
--- a/test/Sema/implicit-int.c
+++ b/test/Sema/implicit-int.c
@@ -1,4 +1,10 @@
-// RUN: clang -fsyntax-only %s
+// RUN: clang -fsyntax-only %s -verify -pedantic
-foo() {
+foo() { // expected-warning {{type specifier missing, defaults to 'int'}}
}
+
+y; // expected-warning {{type specifier missing, defaults to 'int'}}
+
+// rdar://6131634
+void f((x)); // expected-warning {{type specifier missing, defaults to 'int'}}
+
diff --git a/test/Sema/invalid-decl.c b/test/Sema/invalid-decl.c
index efc199d..17f3168 100644
--- a/test/Sema/invalid-decl.c
+++ b/test/Sema/invalid-decl.c
@@ -6,7 +6,7 @@
// PR2400
-typedef xtype (*zend_stream_fsizer_t)(void* handle); // expected-error {{function cannot return array or function type}}
+typedef xtype (*zend_stream_fsizer_t)(void* handle); // expected-error {{function cannot return array or function type}} expected-warning {{type specifier missing, defaults to 'int'}} expected-warning {{type specifier missing, defaults to 'int'}}
typedef struct _zend_module_entry zend_module_entry;
struct _zend_module_entry {
diff --git a/test/Sema/invalid-struct-init.c b/test/Sema/invalid-struct-init.c
index fb96592..9777a27 100644
--- a/test/Sema/invalid-struct-init.c
+++ b/test/Sema/invalid-struct-init.c
@@ -3,7 +3,10 @@
typedef struct _zend_module_entry zend_module_entry;
struct _zend_module_entry {
_efree((p)); // expected-error{{type name requires a specifier or qualifier}} \
- // expected-error{{field '_efree' declared as a function}}
+ expected-error{{field '_efree' declared as a function}} \
+ expected-warning {{type specifier missing, defaults to 'int'}} \
+ expected-warning {{type specifier missing, defaults to 'int'}}
+
};
typedef struct _zend_function_entry { } zend_function_entry;
typedef struct _zend_pcre_globals { } zend_pcre_globals;