xref: /illumos-gate/usr/src/tools/smatch/src/validation/incomplete-struct.c (revision eb9a1df2aeb866bf1de4494433b6d7e5fa07b3ae)
1 struct s;
2 
3 void foo(struct s s)
4 {
5 }
6 
7 struct s bar(void)
8 {
9 	struct s s;
10 	return s;
11 }
12 
13 /*
14  * check-name: incomplete struct
15  * check-command: sparse -Wno-decl $file
16  * check-known-to-fail
17  *
18  * check-error-start
19 incomplete-struct.c:3:19: error: parameter 's' has incomplete type
20 incomplete-struct.c:7:10: error: return type is incomplete
21 incomplete-struct.c:9:11: error: 's' has incompelete type
22  * check-error-end
23  */
24