Home | History | Annotate | Line # | Download | only in lint1
msg_211.c revision 1.3
      1 /*	$NetBSD: msg_211.c,v 1.3 2021/08/16 18:51:58 rillig Exp $	*/
      2 # 3 "msg_211.c"
      3 
      4 // Test for message: return value type mismatch (%s) and (%s) [211]
      5 
      6 struct str {
      7 	int member;
      8 };
      9 
     10 int
     11 return_int(double dbl, void *ptr, struct str str)
     12 {
     13 	if (dbl > 0.0)
     14 		return dbl;
     15 	if (ptr != (void *)0)
     16 		/* expect+1: warning: illegal combination of integer (int) and pointer (pointer to void) [183] */
     17 		return ptr;
     18 	if (str.member > 0)
     19 		/* expect+1: error: return value type mismatch (int) and (struct str) [211 */
     20 		return str;
     21 	return 3;
     22 }
     23