zephyr/tests/net
Tom Hughes 9e85669482 tests: net: socket: Fix -Wsometimes-uninitialized warning
Building with clang warns:

tests/net/socket/tcp/src/main.c:377:13: error: variable 'c_sock' is used
uninitialized whenever 'if' condition is false
[-Werror,-Wsometimes-uninitialized]
        } else if (family == AF_INET6) {
                   ^~~~~~~~~~~~~~~~~~
tests/net/socket/tcp/src/main.c:396:15: note: uninitialized use occurs here
        test_connect(c_sock, s_saddr, addrlen);
                     ^~~~~~
tests/net/socket/tcp/src/main.c:377:9: note: remove the 'if' if its
condition is always true
        } else if (family == AF_INET6) {
               ^~~~~~~~~~~~~~~~~~~~~~~~
tests/net/socket/tcp/src/main.c:360:12: note: initialize the variable
'c_sock' to silence this warning
        int c_sock;
                  ^
                   = 0
tests/net/socket/tcp/src/main.c:377:13: error: variable 's_sock' is used
uninitialized whenever 'if' condition is false
[-Werror,-Wsometimes-uninitialized]
        } else if (family == AF_INET6) {
                   ^~~~~~~~~~~~~~~~~~
tests/net/socket/tcp/src/main.c:387:12: note: uninitialized use occurs here
        test_bind(s_sock, s_saddr, addrlen);
                  ^~~~~~
tests/net/socket/tcp/src/main.c:377:9: note: remove the 'if' if its
condition is always true
        } else if (family == AF_INET6) {
               ^~~~~~~~~~~~~~~~~~~~~~~~
tests/net/socket/tcp/src/main.c:361:12: note: initialize the variable
's_sock' to silence this warning
        int s_sock;
                  ^
                   = 0

Not really needed since we have zassert_unreachable(), but doesn't hurt
to initialize the variables.

Signed-off-by: Tom Hughes <tomhughes@chromium.org>
2025-02-07 02:23:24 +01:00
..
6lo
all net: openthread: Allow a platform to select a Settings backend. 2024-12-02 18:18:20 +01:00
arp tests: net: arp: Remove the ARP cache clear from the tests 2025-01-21 19:29:55 +01:00
bridge tests: net: bridge: Update the bridging tests 2024-09-06 18:01:15 -04:00
checksum_offload lib: net_buf: rename header file from zephyr/net/buf.h to zephyr/net_buf.h 2024-09-07 11:19:05 -05:00
conn_mgr_conn test: Apply semantic patch file ztest_strcmp.cocci 2024-06-14 19:25:42 +02:00
conn_mgr_monitor samples, tests: remove usage of space-separated lists 2024-12-04 14:14:53 -05:00
context lib: net_buf: rename header file from zephyr/net/buf.h to zephyr/net_buf.h 2024-09-07 11:19:05 -05:00
dhcpv4 samples, tests: remove usage of space-separated lists 2024-12-04 14:14:53 -05:00
dhcpv6 samples, tests: remove usage of space-separated lists 2024-12-04 14:14:53 -05:00
ethernet_mgmt
hostname lib: net_buf: rename header file from zephyr/net/buf.h to zephyr/net_buf.h 2024-09-07 11:19:05 -05:00
icmp samples, tests: remove usage of space-separated lists 2024-12-04 14:14:53 -05:00
icmpv4 lib: net_buf: rename header file from zephyr/net/buf.h to zephyr/net_buf.h 2024-09-07 11:19:05 -05:00
icmpv6 lib: net_buf: rename header file from zephyr/net/buf.h to zephyr/net_buf.h 2024-09-07 11:19:05 -05:00
ieee802154 tests/net: Don't test on native_posix 2024-09-25 04:04:36 -04:00
iface tests: net: ipv6: Add tests for stable IIDs 2024-11-16 15:55:49 -05:00
igmp tests: net: igmp: Add re-join multicast group test 2024-12-19 10:20:56 +01:00
ip-addr tests: net: ip-addr: Add test case verifying default iface is preferred 2024-11-29 11:44:39 +01:00
ipv4_fragment tests: net: ipv4_fragment: Make test to run faster 2024-11-18 07:26:07 -05:00
ipv6 tests: net: ipv6: Increase stack size for variable buf test 2025-01-28 14:13:21 +01:00
ipv6_fragment tests: net: ipv6_fragment: Add PMTU testing 2024-11-18 07:26:07 -05:00
lib net: dns: Fix DNS caching bug 2025-02-05 23:49:17 +01:00
mgmt
mld net: ipv6: Make Multicast Listener Discovery API public 2024-10-08 17:00:06 +02:00
mocks
neighbor
net_pkt tests: net: pkt: Add build test for allocation statistics 2024-10-22 20:38:57 +02:00
npf
offloaded_netdev test: net: offloaded_netdev: Add tests for IPv4/6 address registration 2024-09-23 14:08:34 +01:00
pm tests/samples: net: Fix the max number of file descriptors 2024-09-30 17:12:15 +01:00
pmtu tests: net: pmtu: Add IPV6_MTU socket option tests 2024-11-18 07:26:07 -05:00
ppp/driver lib: net_buf: rename header file from zephyr/net/buf.h to zephyr/net_buf.h 2024-09-07 11:19:05 -05:00
promiscuous
ptp/clock drivers: ptp_clock: Place API into iterable section 2024-12-02 23:04:22 +01:00
route lib: net_buf: rename header file from zephyr/net/buf.h to zephyr/net_buf.h 2024-09-07 11:19:05 -05:00
route_mcast lib: net_buf: rename header file from zephyr/net/buf.h to zephyr/net_buf.h 2024-09-07 11:19:05 -05:00
shell lib: net_buf: rename header file from zephyr/net/buf.h to zephyr/net_buf.h 2024-09-07 11:19:05 -05:00
socket tests: net: socket: Fix -Wsometimes-uninitialized warning 2025-02-07 02:23:24 +01:00
tcp misc: move lorem ipsum text to zephyr/misc/lorem_ipsum.h 2024-08-02 03:31:06 -04:00
traffic_class tests/net: Don't test on native_posix 2024-09-25 04:04:36 -04:00
trickle lib: net_buf: rename header file from zephyr/net/buf.h to zephyr/net_buf.h 2024-09-07 11:19:05 -05:00
tx_timestamp lib: net_buf: rename header file from zephyr/net/buf.h to zephyr/net_buf.h 2024-09-07 11:19:05 -05:00
udp lib: net_buf: rename header file from zephyr/net/buf.h to zephyr/net_buf.h 2024-09-07 11:19:05 -05:00
utils net: utils: Port parsing failure in net_ipaddr_parse() 2024-11-16 13:51:27 -05:00
virtual lib: net_buf: rename header file from zephyr/net/buf.h to zephyr/net_buf.h 2024-09-07 11:19:05 -05:00
vlan tests: net: vlan: Support case where VLAN count is 0 2025-01-31 16:12:50 +01:00
wifi tests: wifi: configs: Add a test for disable of advanced features 2025-01-15 19:06:22 +01:00