From: flu0r1ne Date: Mon, 2 Oct 2023 23:10:43 +0000 (-0500) Subject: Annotate `set_privileged_socket_opt` with UNUSED X-Git-Tag: v0.96~21^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=74645e05ecb66d876dc7669df6e8f17c95679845;p=thirdparty%2Fmtr.git Annotate `set_privileged_socket_opt` with UNUSED The `set_privileged_socket_opt` function is currently called only when `SO_MARK` or `SO_BINDTODEVICE` are defined. On systems that do not support either feature, `set_privileged_socket_opt` is expected to be unused. Adding an annotation suppresses compiler warnings. --- diff --git a/packet/construct_unix.c b/packet/construct_unix.c index 8df9997..0d3b1f2 100644 --- a/packet/construct_unix.c +++ b/packet/construct_unix.c @@ -294,21 +294,19 @@ int construct_udp6_packet( typedef cap_value_t mayadd_cap_value_t; #define MAYADD_CAP_NET_RAW CAP_NET_RAW #define MAYADD_CAP_NET_ADMIN CAP_NET_ADMIN -#define MAYADD_UNUSED #else /* ifdef HAVE_LIBCAP */ typedef int mayadd_cap_value_t; #define MAYADD_CAP_NET_RAW ((mayadd_cap_value_t) 0) #define MAYADD_CAP_NET_ADMIN ((mayadd_cap_value_t) 0) -#define MAYADD_UNUSED UNUSED #endif /* ifdef HAVE_LIBCAP */ -static +UNUSED static int set_privileged_socket_opt(int socket, int option_name, void const * option_value, socklen_t option_len, - MAYADD_UNUSED mayadd_cap_value_t required_cap) { + UNUSED mayadd_cap_value_t required_cap) { int result = -1;