Home | History | Annotate | Line # | Download | only in lint1
msg_240.c revision 1.5
      1 /*	$NetBSD: msg_240.c,v 1.5 2023/07/07 06:03:31 rillig Exp $	*/
      2 # 3 "msg_240.c"
      3 
      4 // Test for message: assignment of different structures (%s != %s) [240]
      5 // This message is not used.
      6 
      7 struct s_arg {
      8 	int member;
      9 };
     10 
     11 struct s_local {
     12 	int member;
     13 };
     14 
     15 struct s_return {
     16 	int member;
     17 };
     18 
     19 union u_arg {
     20 	int member;
     21 };
     22 
     23 /* expect+2: warning: argument 's_arg' unused in function 'return_other_struct' [231] */
     24 struct s_return
     25 return_other_struct(struct s_arg s_arg)
     26 {
     27 	/* XXX: No warning? */
     28 	return s_arg;
     29 }
     30 
     31 /* expect+2: warning: argument 's_arg' unused in function 'assign_other_struct' [231] */
     32 void
     33 assign_other_struct(struct s_arg s_arg)
     34 {
     35 	/* expect+1: warning: 's_local' unused in function 'assign_other_struct' [192] */
     36 	static struct s_local s_local;
     37 	/* XXX: No warning? */
     38 	s_local = s_arg;
     39 }
     40 
     41 /* expect+2: warning: argument 'u_arg' unused in function 'return_other_union' [231] */
     42 struct s_return
     43 return_other_union(union u_arg u_arg)
     44 {
     45 	/* XXX: No warning? */
     46 	return u_arg;
     47 }
     48