xref: /illumos-gate/usr/src/tools/smatch/src/validation/bad-return-type.c (revision ea78de644e058ee2f6b1c6bb50fcc07da6e4d7ac)
1 void foo(int a)
2 {
3 	return a;
4 }
5 
6 int bar(void)
7 {
8 	return;
9 }
10 
11 /*
12  * check-name: bad return type
13  * check-command: sparse -Wno-decl $file
14  *
15  * check-error-start
16 bad-return-type.c:3:16: error: return expression in void function
17 bad-return-type.c:8:9: error: return with no return value
18  * check-error-end
19  */
20