2023-08-02 21:51:25 +03:00
|
|
|
/* $NetBSD: msg_240.c,v 1.8 2023/08/02 18:51:25 rillig Exp $ */
|
2021-01-02 13:22:42 +03:00
|
|
|
# 3 "msg_240.c"
|
|
|
|
|
|
|
|
// Test for message: assignment of different structures (%s != %s) [240]
|
2022-06-17 00:24:41 +03:00
|
|
|
// This message is not used.
|
2021-01-02 13:22:42 +03:00
|
|
|
|
2023-07-07 22:45:22 +03:00
|
|
|
/* lint1-extra-flags: -X 351 */
|
|
|
|
|
2023-08-02 21:51:25 +03:00
|
|
|
struct s_param {
|
2022-06-17 00:24:41 +03:00
|
|
|
int member;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct s_local {
|
|
|
|
int member;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct s_return {
|
|
|
|
int member;
|
|
|
|
};
|
|
|
|
|
|
|
|
union u_arg {
|
|
|
|
int member;
|
|
|
|
};
|
|
|
|
|
2023-08-02 21:51:25 +03:00
|
|
|
/* expect+2: warning: parameter 's_param' unused in function 'return_other_struct' [231] */
|
2022-06-17 00:24:41 +03:00
|
|
|
struct s_return
|
2023-08-02 21:51:25 +03:00
|
|
|
return_other_struct(struct s_param s_param)
|
2022-06-17 00:24:41 +03:00
|
|
|
{
|
|
|
|
/* XXX: No warning? */
|
2023-08-02 21:51:25 +03:00
|
|
|
return s_param;
|
2022-06-17 00:24:41 +03:00
|
|
|
}
|
|
|
|
|
2023-08-02 21:51:25 +03:00
|
|
|
/* expect+2: warning: parameter 's_param' unused in function 'assign_other_struct' [231] */
|
2022-06-17 00:24:41 +03:00
|
|
|
void
|
2023-08-02 21:51:25 +03:00
|
|
|
assign_other_struct(struct s_param s_param)
|
2022-06-17 00:24:41 +03:00
|
|
|
{
|
2023-07-07 09:03:31 +03:00
|
|
|
/* expect+1: warning: 's_local' unused in function 'assign_other_struct' [192] */
|
2022-06-17 00:24:41 +03:00
|
|
|
static struct s_local s_local;
|
|
|
|
/* XXX: No warning? */
|
2023-08-02 21:51:25 +03:00
|
|
|
s_local = s_param;
|
2022-06-17 00:24:41 +03:00
|
|
|
}
|
|
|
|
|
2023-07-09 14:18:55 +03:00
|
|
|
/* expect+2: warning: parameter 'u_arg' unused in function 'return_other_union' [231] */
|
2022-06-17 00:24:41 +03:00
|
|
|
struct s_return
|
|
|
|
return_other_union(union u_arg u_arg)
|
|
|
|
{
|
|
|
|
/* XXX: No warning? */
|
|
|
|
return u_arg;
|
|
|
|
}
|