From: Eero Tamminen Date: Fri, 4 Feb 2022 10:20:27 +0000 (+0200) Subject: Attribute unused function args as such in few of the plugins X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0cee98e8e0323a9dcfc18ab63d70fed4081d04ba;p=thirdparty%2Fcollectd.git Attribute unused function args as such in few of the plugins Based on "-O3 -Werror -Wall -Wextra -Wformat-security" output. --- diff --git a/src/cgroups.c b/src/cgroups.c index 892523984..2831253f7 100644 --- a/src/cgroups.c +++ b/src/cgroups.c @@ -52,7 +52,7 @@ cgroups_submit_one(char const *plugin_instance, char const *type_instance, * This callback reads the user/system CPU time for each cgroup. */ static int read_cpuacct_procs(const char *dirname, char const *cgroup_name, - void *user_data) { + __attribute__((unused)) void *user_data) { char abs_path[PATH_MAX]; struct stat statbuf; char buf[1024]; @@ -131,7 +131,7 @@ static int read_cpuacct_procs(const char *dirname, char const *cgroup_name, * read_cpuacct_procs callback on every folder it finds, such as "system". */ static int read_cpuacct_root(const char *dirname, const char *filename, - void *user_data) { + __attribute__((unused)) void *user_data) { char abs_path[PATH_MAX]; struct stat statbuf; int status; diff --git a/src/conntrack.c b/src/conntrack.c index 7b61eef08..867b3cb6c 100644 --- a/src/conntrack.c +++ b/src/conntrack.c @@ -43,7 +43,8 @@ static int config_keys_num = STATIC_ARRAY_SIZE(config_keys); static int old_files; -static int conntrack_config(const char *key, const char *value) { +static int conntrack_config(const char *key, + __attribute__((unused)) const char *value) { if (strcmp(key, "OldFiles") == 0) old_files = 1; diff --git a/src/statsd.c b/src/statsd.c index 3d852ccde..5612737b1 100644 --- a/src/statsd.c +++ b/src/statsd.c @@ -550,7 +550,7 @@ static int statsd_network_init(struct pollfd **ret_fds, /* {{{ */ return 0; } /* }}} int statsd_network_init */ -static void *statsd_network_thread(void *args) /* {{{ */ +static void *statsd_network_thread(__attribute__((unused)) void *args) /* {{{ */ { struct pollfd *fds = NULL; size_t fds_num = 0; diff --git a/src/turbostat.c b/src/turbostat.c index 8bbb92b55..27a04655b 100644 --- a/src/turbostat.c +++ b/src/turbostat.c @@ -835,7 +835,8 @@ for_all_cpus_delta(const struct thread_data *thread_new_base, * Package Thermal Management Sensor (PTM), and thermal event thresholds. */ static int __attribute__((warn_unused_result)) -set_temperature_target(struct thread_data *t, struct core_data *c, +set_temperature_target(struct thread_data *t, + __attribute__((unused)) struct core_data *c, struct pkg_data *p) { unsigned long long msr; unsigned int target_c_local;