diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-04-09 17:53:29 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-04-09 17:53:29 +0000 |
commit | 08a41901e18aeb91b87d031b93df70374af02564 (patch) | |
tree | 7416b74f2ee31c6c794a7923e830ba57f5cef716 /test/Sema/array-init.c | |
parent | 47268a3f2843a8d64f3a6fef1e9a9dde1feb4a8c (diff) |
Improve diagnostics like "initializing <type> from an expression of
type..." with "initializing <type> with an expression of type...",
which reads better. Thanks to John for the improved wording.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100873 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/array-init.c')
-rw-r--r-- | test/Sema/array-init.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/test/Sema/array-init.c b/test/Sema/array-init.c index ac45ff77c8..f93b0878fd 100644 --- a/test/Sema/array-init.c +++ b/test/Sema/array-init.c @@ -9,7 +9,7 @@ int ary2[] = { x, y, z }; // expected-error{{initializer element is not a compil extern int fileScopeExtern[3] = { 1, 3, 5 }; // expected-warning{{'extern' variable has an initializer}} -static long ary3[] = { 1, "abc", 3, 4 }; // expected-warning{{incompatible pointer to integer conversion initializing 'long' from an expression of type 'char [4]'}} +static long ary3[] = { 1, "abc", 3, 4 }; // expected-warning{{incompatible pointer to integer conversion initializing 'long' with an expression of type 'char [4]'}} void func() { int x = 1; @@ -44,11 +44,11 @@ void func() { int a,b,c; } z = { 1 }; - struct threeElements *p = 7; // expected-warning{{incompatible integer to pointer conversion initializing 'struct threeElements *' from an expression of type 'int'}} + struct threeElements *p = 7; // expected-warning{{incompatible integer to pointer conversion initializing 'struct threeElements *' with an expression of type 'int'}} extern int blockScopeExtern[3] = { 1, 3, 5 }; // expected-error{{'extern' variable cannot have an initializer}} - static long x2[3] = { 1.0, "abc" , 5.8 }; // expected-warning{{incompatible pointer to integer conversion initializing 'long' from an expression of type 'char [4]'}} + static long x2[3] = { 1.0, "abc" , 5.8 }; // expected-warning{{incompatible pointer to integer conversion initializing 'long' with an expression of type 'char [4]'}} } void test() { @@ -155,10 +155,10 @@ void charArrays() { char c[] = { "Hello" }; int l[sizeof(c) == 6 ? 1 : -1]; - int i[] = { "Hello "}; // expected-warning{{incompatible pointer to integer conversion initializing 'int' from an expression of type 'char [7]'}} + int i[] = { "Hello "}; // expected-warning{{incompatible pointer to integer conversion initializing 'int' with an expression of type 'char [7]'}} char c2[] = { "Hello", "Good bye" }; //expected-warning{{excess elements in char array initializer}} - int i2[1] = { "Hello" }; //expected-warning{{incompatible pointer to integer conversion initializing 'int' from an expression of type 'char [6]'}} + int i2[1] = { "Hello" }; //expected-warning{{incompatible pointer to integer conversion initializing 'int' with an expression of type 'char [6]'}} char c3[5] = { "Hello" }; char c4[4] = { "Hello" }; //expected-warning{{initializer-string for char array is too long}} @@ -191,12 +191,12 @@ void autoStructTest() { struct s1 {char a; char b;} t1; struct s2 {struct s1 c;} t2 = { t1 }; // The following is a less than great diagnostic (though it's on par with EDG). -struct s1 t3[] = {t1, t1, "abc", 0}; //expected-warning{{incompatible pointer to integer conversion initializing 'char' from an expression of type 'char [4]'}} +struct s1 t3[] = {t1, t1, "abc", 0}; //expected-warning{{incompatible pointer to integer conversion initializing 'char' with an expression of type 'char [4]'}} int t4[sizeof t3 == 6 ? 1 : -1]; } struct foo { int z; } w; int bar (void) { - struct foo z = { w }; //expected-error{{initializing 'int' from an expression of incompatible type 'struct foo'}} + struct foo z = { w }; //expected-error{{initializing 'int' with an expression of incompatible type 'struct foo'}} return z.z; } struct s3 {void (*a)(void);} t5 = {autoStructTest}; |