]> git.meshlink.io Git - meshlink/commit
Fix __warn_unused_result__, add more of it and fix the resulting warnings.
authorGuus Sliepen <guus@meshlink.io>
Sat, 9 Nov 2019 16:57:55 +0000 (17:57 +0100)
committerGuus Sliepen <guus@meshlink.io>
Sat, 9 Nov 2019 17:33:57 +0000 (18:33 +0100)
commitfe5563f92021618b4a8b41e412c73d8364fcaf6e
treeb5222937b04812e8a8bc60c3e6991491befc74f0
parent6c897377f68fc23ca9a8b23a6ca204517998b2e9
Fix __warn_unused_result__, add more of it and fix the resulting warnings.

Due to a bug in the autoconf test for function attributes, we were always
disabling __warn_unused_result__. Fix this, and add this function attribute
to a lot more functions whose results are definitely important.

This change makes it clear where we ignore the results of a function that
might fail. The proper fix in most cases is to propagate the result to the
caller. For meshlink_blacklist() and meshlink_whitelist(), we were not
return an error condition, even if we might fail to commit the blacklist
operation to permanent storage. So we now make these functions return a
bool.
111 files changed:
examples/channels.c
examples/chat.c
examples/groupchat.c
examples/manynodes.c
examples/meshlinkapp.c
m4/attribute.m4
src/conf.c
src/conf.h
src/edge.h
src/event.h
src/fake-getaddrinfo.h
src/fake-getnameinfo.h
src/meshlink++.h
src/meshlink.c
src/meshlink.h
src/meshlink_queue.h
src/meta.h
src/net.c
src/net.h
src/net_packet.c
src/net_setup.c
src/net_socket.c
src/netutl.h
src/node.h
src/packmsg.h
src/protocol.h
src/protocol_auth.c
src/protocol_key.c
src/sptps.h
src/submesh.h
src/utils.h
src/xoshiro.h
test/blackbox/run_blackbox_tests/test_cases_add_addr.c
test/blackbox/run_blackbox_tests/test_cases_add_ex_addr.c
test/blackbox/run_blackbox_tests/test_cases_autoconnect.c
test/blackbox/run_blackbox_tests/test_cases_blacklist.c
test/blackbox/run_blackbox_tests/test_cases_channel_blacklist.c
test/blackbox/run_blackbox_tests/test_cases_channel_close.c
test/blackbox/run_blackbox_tests/test_cases_channel_ex.c
test/blackbox/run_blackbox_tests/test_cases_channel_get_flags.c
test/blackbox/run_blackbox_tests/test_cases_channel_open.c
test/blackbox/run_blackbox_tests/test_cases_channel_send.c
test/blackbox/run_blackbox_tests/test_cases_channel_set_accept_cb.c
test/blackbox/run_blackbox_tests/test_cases_channel_set_poll_cb.c
test/blackbox/run_blackbox_tests/test_cases_channel_set_receive_cb.c
test/blackbox/run_blackbox_tests/test_cases_channel_shutdown.c
test/blackbox/run_blackbox_tests/test_cases_default_blacklist.c
test/blackbox/run_blackbox_tests/test_cases_export.c
test/blackbox/run_blackbox_tests/test_cases_get_all_nodes.c
test/blackbox/run_blackbox_tests/test_cases_get_all_nodes_by_dev_class.c
test/blackbox/run_blackbox_tests/test_cases_get_ex_addr.c
test/blackbox/run_blackbox_tests/test_cases_get_fingerprint.c
test/blackbox/run_blackbox_tests/test_cases_get_node.c
test/blackbox/run_blackbox_tests/test_cases_get_port.c
test/blackbox/run_blackbox_tests/test_cases_get_self.c
test/blackbox/run_blackbox_tests/test_cases_hint_address.c
test/blackbox/run_blackbox_tests/test_cases_import.c
test/blackbox/run_blackbox_tests/test_cases_invite.c
test/blackbox/run_blackbox_tests/test_cases_join.c
test/blackbox/run_blackbox_tests/test_cases_key_rotation.c
test/blackbox/run_blackbox_tests/test_cases_open.c
test/blackbox/run_blackbox_tests/test_cases_pmtu.c
test/blackbox/run_blackbox_tests/test_cases_random_port_bindings01.c
test/blackbox/run_blackbox_tests/test_cases_random_port_bindings02.c
test/blackbox/run_blackbox_tests/test_cases_rec_cb.c
test/blackbox/run_blackbox_tests/test_cases_send.c
test/blackbox/run_blackbox_tests/test_cases_set_connection_try_cb.c
test/blackbox/run_blackbox_tests/test_cases_set_log_cb.c
test/blackbox/run_blackbox_tests/test_cases_set_port.c
test/blackbox/run_blackbox_tests/test_cases_sign.c
test/blackbox/run_blackbox_tests/test_cases_start.c
test/blackbox/run_blackbox_tests/test_cases_status_cb.c
test/blackbox/run_blackbox_tests/test_cases_verify.c
test/blackbox/run_blackbox_tests/test_cases_whitelist.c
test/blackbox/run_blackbox_tests/test_optimal_pmtu.c
test/blackbox/test_case_channel_blacklist_01/node_sim_nut_01.c
test/blackbox/test_case_channel_blacklist_01/node_sim_relay_01.c
test/blackbox/test_case_channel_conn_04/node_sim_nut.c
test/blackbox/test_case_channel_conn_05/node_sim_relay.c
test/blackbox/test_case_channel_conn_06/node_sim_relay.c
test/blackbox/test_case_channel_conn_07/node_sim_relay.c
test/blackbox/test_case_channel_conn_08/node_sim_nut.c
test/blackbox/test_case_channel_conn_08/node_sim_relay.c
test/blackbox/test_case_meta_conn_01/node_sim_nut.c
test/blackbox/test_case_meta_conn_01/node_sim_peer.c
test/blackbox/test_case_meta_conn_01/node_sim_relay.c
test/blackbox/test_case_meta_conn_02/node_sim_nut.c
test/blackbox/test_case_meta_conn_02/node_sim_peer.c
test/blackbox/test_case_meta_conn_02/node_sim_relay.c
test/blackbox/test_case_meta_conn_03/node_sim_nut.c
test/blackbox/test_case_meta_conn_03/node_sim_peer.c
test/blackbox/test_case_meta_conn_03/node_sim_relay.c
test/blackbox/test_case_meta_conn_04/node_sim_nut.c
test/blackbox/test_case_meta_conn_04/node_sim_peer.c
test/blackbox/test_case_meta_conn_04/node_sim_relay.c
test/blackbox/test_case_meta_conn_05/node_sim_nut.c
test/blackbox/test_case_meta_conn_05/node_sim_peer.c
test/blackbox/test_case_meta_conn_05/node_sim_relay.c
test/blackbox/test_case_optimal_pmtu_01/node_sim_nut.c
test/blackbox/test_case_optimal_pmtu_01/node_sim_relay.c
test/blackbox/test_cases_submesh04/node_sim_app1node2.c
test/channels-cornercases.c
test/channels-fork.c
test/channels-no-partial.c
test/channels.c
test/duplicate.c
test/import-export.c
test/invite-join.c
test/trio.c
test/trio2.c
test/utils.c