Skip to content

Commit 7912d11

Browse files
matttbegregkh
authored andcommitted
selftests: mptcp: sockopt: fix C23 extension warning
commit 3259889 upstream. GCC was complaining about the new label: mptcp_inq.c:79:2: warning: label followed by a declaration is a C23 extension [-Wc23-extensions] 79 | int err = getaddrinfo(node, service, hints, res); | ^ mptcp_sockopt.c:166:2: warning: label followed by a declaration is a C23 extension [-Wc23-extensions] 166 | int err = getaddrinfo(node, service, hints, res); | ^ Simply declare 'err' before the label to avoid this warning. Fixes: dd367e8 ("selftests: mptcp: sockopt: use IPPROTO_MPTCP for getaddrinfo") Cc: stable@vger.kernel.org Reviewed-by: Geliang Tang <geliang@kernel.org> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> Link: https://patch.msgid.link/20250815-net-mptcp-misc-fixes-6-17-rc2-v1-8-521fe9957892@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 201a991 commit 7912d11

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

tools/testing/selftests/net/mptcp/mptcp_inq.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,10 @@ static void xgetaddrinfo(const char *node, const char *service,
7575
struct addrinfo *hints,
7676
struct addrinfo **res)
7777
{
78-
again:
79-
int err = getaddrinfo(node, service, hints, res);
78+
int err;
8079

80+
again:
81+
err = getaddrinfo(node, service, hints, res);
8182
if (err) {
8283
const char *errstr;
8384

tools/testing/selftests/net/mptcp/mptcp_sockopt.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,10 @@ static void xgetaddrinfo(const char *node, const char *service,
162162
struct addrinfo *hints,
163163
struct addrinfo **res)
164164
{
165-
again:
166-
int err = getaddrinfo(node, service, hints, res);
165+
int err;
167166

167+
again:
168+
err = getaddrinfo(node, service, hints, res);
168169
if (err) {
169170
const char *errstr;
170171

0 commit comments

Comments
 (0)