]> andersk Git - splint.git/blame - test/arrayinit.c
noexpand always false.
[splint.git] / test / arrayinit.c
CommitLineData
7534721d 1int x[3] = { 1 , 2, 3, 4 } ; /* Initializer block for x has 4 elements, but declared as int[3] */
2int a[3] = { 1 , 2 } ; /* Initializer block for a has 2 elements, but declared as int[3] */
3int aa[3][3] = { { 1 , 2, 3 }, /* Initializer block for aa has 2 elements, but declared as int[3][3] */
4 { 4, 5 } } ; /* Initializer block for aa[1] has 2 elements, but declared as int [3] */
5
6int ab[] = { 1, 2, 3 } ;
7
8char cc[3] = { 'a', 'b', 'c' } ;
9char cs[3] = "ab";
10char cs1[3] = "abc"; /* gcc doesn't warn for this */ /* stringliteralnoroom */
11char cs2[3] = "abcd"; /* gcc warns for this with -Wall */ /* stringliteraltoolong */
12char cs3[3] = "a"; /* stringliteral smaller (not on default) */
13
14char csx[3][3] = { { 'a', 'b', 'c' } , "def", "gasdf" } ; /* 2 errors */
393e573f 15
16int a2[][2] = {{1,2},{3,4},{5,6}};
17int a3[][2] = {{1,2},{3,4,5},{5,6}};
This page took 0.272543 seconds and 5 git commands to generate.