xref: /netbsd-src/tests/usr.bin/xlint/lint1/msg_301.c (revision ccd9df534e375a4366c5b55f23782053c7a98d82)
1 /*	$NetBSD: msg_301.c,v 1.4 2023/03/28 14:44:35 rillig Exp $	*/
2 # 3 "msg_301.c"
3 
4 // Test for message: array of incomplete type [301]
5 // This message is not used.
6 // TODO: This message occurs in the code but is deactivated.
7 
8 /* lint1-extra-flags: -X 351 */
9 
10 /* expect+1: warning: struct 'incomplete' never defined [233] */
11 struct incomplete;
12 
13 /* expect+1: error: 'var' has incomplete type 'incomplete struct incomplete' [31] */
14 struct incomplete var[3];
15 
16 /* expect+1: error: cannot take size/alignment of incomplete type [143] */
17 unsigned long sizeof_3 = sizeof(struct incomplete[3]);
18