Tue Mar 30 16:09:30 2021 UTC ()
tests/lint: remove unnecessary empty lines from test

In a separate commit to not cause an unnecessarily large diff in the
previous commit.


(rillig)
diff -r1.27 -r1.28 src/tests/usr.bin/xlint/lint1/d_c99_init.c
diff -r1.21 -r1.22 src/tests/usr.bin/xlint/lint1/d_c99_init.exp

cvs diff -r1.27 -r1.28 src/tests/usr.bin/xlint/lint1/d_c99_init.c (expand / switch to unified diff)

--- src/tests/usr.bin/xlint/lint1/d_c99_init.c 2021/03/30 16:07:07 1.27
+++ src/tests/usr.bin/xlint/lint1/d_c99_init.c 2021/03/30 16:09:30 1.28
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: d_c99_init.c,v 1.27 2021/03/30 16:07:07 rillig Exp $ */ 1/* $NetBSD: d_c99_init.c,v 1.28 2021/03/30 16:09:30 rillig Exp $ */
2# 3 "d_c99_init.c" 2# 3 "d_c99_init.c"
3 3
4/* 4/*
5 * Test C99 initializers. 5 * Test C99 initializers.
6 * 6 *
7 * See C99 6.7.8 "Initialization". 7 * See C99 6.7.8 "Initialization".
8*/ 8*/
9 9
10 10
11void use(const void *); 11void use(const void *);
12 12
13typedef struct any { 13typedef struct any {
14 const void *value; 14 const void *value;
@@ -125,27 +125,26 @@ struct point { @@ -125,27 +125,26 @@ struct point {
125struct point point = { 125struct point point = {
126 3, 126 3,
127 4 127 4
128}; 128};
129 129
130struct point point_with_designators = { 130struct point point_with_designators = {
131 .y = 4, 131 .y = 4,
132 .x = 3, 132 .x = 3,
133}; 133};
134 134
135struct point point_with_mixed_designators = { 135struct point point_with_mixed_designators = {
136 .x = 3, 136 .x = 3,
137 4, 137 4,
138 
139 5, /* expect: too many struct/union initializers */ 138 5, /* expect: too many struct/union initializers */
140 .x = 3, 139 .x = 3,
141}; 140};
142 141
143int array_with_designator[] = { 142int array_with_designator[] = {
144 111, 143 111,
145 .member = 222, /* expect: 249 */ 144 .member = 222, /* expect: 249 */
146 333, 145 333,
147}; 146};
148 147
149/* 148/*
150 * C99 6.7.8p11 says that the initializer of a scalar can be "optionally 149 * C99 6.7.8p11 says that the initializer of a scalar can be "optionally
151 * enclosed in braces". It does not explicitly set an upper limit on the 150 * enclosed in braces". It does not explicitly set an upper limit on the
@@ -201,27 +200,26 @@ struct pentagon { @@ -201,27 +200,26 @@ struct pentagon {
201}; 200};
202 201
203struct geometry { 202struct geometry {
204 struct pentagon pentagons[6]; 203 struct pentagon pentagons[6];
205 struct triangle triangles[10]; 204 struct triangle triangles[10];
206 struct point points[3][5][2]; 205 struct point points[3][5][2];
207}; 206};
208 207
209/* 208/*
210 * Initialization of a complex struct containing nested arrays and nested 209 * Initialization of a complex struct containing nested arrays and nested
211 * structs. 210 * structs.
212 */ 211 */
213struct geometry geometry = { 212struct geometry geometry = {
214 
215 .pentagons[0].points[4].x = 1, 213 .pentagons[0].points[4].x = 1,
216 .points[0][0][0] = { 0, 0 }, 214 .points[0][0][0] = { 0, 0 },
217 .points[2][4][1] = {301, 302 }, 215 .points[2][4][1] = {301, 302 },
218 /* expect+1: array subscript cannot be > 2: 3 */ 216 /* expect+1: array subscript cannot be > 2: 3 */
219 .points[3][0][0] = {3001, 3002 }, 217 .points[3][0][0] = {3001, 3002 },
220 /* expect+1: array subscript cannot be > 4: 5 */ 218 /* expect+1: array subscript cannot be > 4: 5 */
221 .points[0][5][0] = {501, 502 }, 219 .points[0][5][0] = {501, 502 },
222 /* expect+1: array subscript cannot be > 1: 2 */ 220 /* expect+1: array subscript cannot be > 1: 2 */
223 .points[0][0][2] = {21, 22 }, 221 .points[0][0][2] = {21, 22 },
224}; 222};
225 223
226struct ends_with_unnamed_bit_field { 224struct ends_with_unnamed_bit_field {
227 int member; 225 int member;

cvs diff -r1.21 -r1.22 src/tests/usr.bin/xlint/lint1/Attic/d_c99_init.exp (expand / switch to unified diff)

--- src/tests/usr.bin/xlint/lint1/Attic/d_c99_init.exp 2021/03/30 16:07:07 1.21
+++ src/tests/usr.bin/xlint/lint1/Attic/d_c99_init.exp 2021/03/30 16:09:30 1.22
@@ -1,24 +1,24 @@ @@ -1,24 +1,24 @@
1d_c99_init.c(23): error: too many initializers [174] 1d_c99_init.c(23): error: too many initializers [174]
2d_c99_init.c(63): error: cannot initialize 'pointer to const void' from 'struct any' [185] 2d_c99_init.c(63): error: cannot initialize 'pointer to const void' from 'struct any' [185]
3d_c99_init.c(80): error: too many array initializers, expected 3 [173] 3d_c99_init.c(80): error: too many array initializers, expected 3 [173]
4d_c99_init.c(139): error: too many struct/union initializers [172] 4d_c99_init.c(138): error: too many struct/union initializers [172]
5d_c99_init.c(145): error: syntax error 'designator '.member' is only for struct/union' [249] 5d_c99_init.c(144): error: syntax error 'designator '.member' is only for struct/union' [249]
6d_c99_init.c(219): error: array subscript cannot be > 2: 3 [168] 6d_c99_init.c(217): error: array subscript cannot be > 2: 3 [168]
7d_c99_init.c(221): error: array subscript cannot be > 4: 5 [168] 7d_c99_init.c(219): error: array subscript cannot be > 4: 5 [168]
8d_c99_init.c(223): error: array subscript cannot be > 1: 2 [168] 8d_c99_init.c(221): error: array subscript cannot be > 1: 2 [168]
9d_c99_init.c(232): error: too many struct/union initializers [172] 9d_c99_init.c(230): error: too many struct/union initializers [172]
10d_c99_init.c(238): warning: illegal combination of integer (char) and pointer (pointer to char) [183] 10d_c99_init.c(236): warning: illegal combination of integer (char) and pointer (pointer to char) [183]
11d_c99_init.c(242): warning: illegal combination of integer (char) and pointer (pointer to char) [183] 11d_c99_init.c(240): warning: illegal combination of integer (char) and pointer (pointer to char) [183]
12d_c99_init.c(281): error: cannot initialize 'struct <unnamed>' from 'int' [185] 12d_c99_init.c(279): error: cannot initialize 'struct <unnamed>' from 'int' [185]
13d_c99_init.c(323): error: duplicate case in switch: 0 [199] 13d_c99_init.c(321): error: duplicate case in switch: 0 [199]
14d_c99_init.c(332): error: type 'struct point' does not have member 'r' [101] 14d_c99_init.c(330): error: type 'struct point' does not have member 'r' [101]
15d_c99_init.c(339): error: type 'struct point' does not have member 'r' [101] 15d_c99_init.c(337): error: type 'struct point' does not have member 'r' [101]
16d_c99_init.c(346): error: type 'struct point' does not have member 'r' [101] 16d_c99_init.c(344): error: type 'struct point' does not have member 'r' [101]
17d_c99_init.c(355): error: type 'union value' does not have member 'unknown_value' [101] 17d_c99_init.c(353): error: type 'union value' does not have member 'unknown_value' [101]
18d_c99_init.c(361): error: type 'union value' does not have member 'unknown_value' [101] 18d_c99_init.c(359): error: type 'union value' does not have member 'unknown_value' [101]
19d_c99_init.c(365): error: syntax error 'designator '[...]' is only for arrays' [249] 19d_c99_init.c(363): error: syntax error 'designator '[...]' is only for arrays' [249]
20d_c99_init.c(366): error: type 'struct point' does not have member 'member' [101] 20d_c99_init.c(364): error: type 'struct point' does not have member 'member' [101]
21d_c99_init.c(372): warning: structure has no named members [65] 21d_c99_init.c(370): warning: structure has no named members [65]
22d_c99_init.c(373): error: too many struct/union initializers [172] 22d_c99_init.c(371): error: too many struct/union initializers [172]
23d_c99_init.c(378): warning: union has no named members [65] 23d_c99_init.c(376): warning: union has no named members [65]
24d_c99_init.c(379): error: too many struct/union initializers [172] 24d_c99_init.c(377): error: too many struct/union initializers [172]