1 /* $NetBSD: msg_240.c,v 1.3 2022/06/16 21:24:41 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 // TODO: Remove the code, as the message is unreachable. 7 8 struct s_arg { 9 int member; 10 }; 11 12 struct s_local { 13 int member; 14 }; 15 16 struct s_return { 17 int member; 18 }; 19 20 union u_arg { 21 int member; 22 }; 23 24 /* expect+2: warning: argument 's_arg' unused in function 'return_other_struct' [231] */ 25 struct s_return 26 return_other_struct(struct s_arg s_arg) 27 { 28 /* XXX: No warning? */ 29 return s_arg; 30 } 31 32 /* expect+2: warning: argument 's_arg' unused in function 'assign_other_struct' [231] */ 33 void 34 assign_other_struct(struct s_arg s_arg) 35 { 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