QNativeSocketEngine: fix warning about uninitialized variables

In function ‘int qt_safe_connect(int, const sockaddr*, socklen_t)’,
    inlined from ‘bool QNativeSocketEnginePrivate::nativeConnect(const QHostAddress&, quint16)
qnet_unix_p.h:111:38: error: ‘sockAddrSize’ may be used uninitialized [-Werror=maybe-uninitialized]
qnativesocketengine_unix.cpp:396:18: note: ‘sockAddrSize’ was declared here
qnativesocketengine_unix.cpp:476:14: error: ‘aa.qt_sockaddr::a.sockaddr::sa_family’ may be used uninitialized [-Werror=maybe-uninitialized]
qnativesocketengine_unix.cpp:471:17: note: ‘aa’ declared here

Introduced by commit 45a03fc506.

Change-Id: I5f7f427ded124479baa6fffd175fbf006c098854
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
Thiago Macieira 2023-05-16 15:06:34 -07:00
parent ea1af6b7ed
commit 52fa66d087

View File

@ -177,8 +177,9 @@ public:
case QHostAddress::UnknownNetworkLayerProtocol:
// don't force
*sockAddrSize = setSockaddr(&aa->a, address, port);
break;
}
*sockAddrSize = setSockaddr(&aa->a, address, port);
}
};