From: Michael Jeanson Date: Wed, 16 Mar 2022 15:57:24 +0000 (-0400) Subject: Clean-up: fix '-Wnused-parameter' warnings on various platforms X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=4eac90eb7d8428fc6c5a75d3f0e795844fb6c574;p=lttng-tools.git Clean-up: fix '-Wnused-parameter' warnings on various platforms Change-Id: I35bd06414fd8407b2f281789ac2e419f40a08fa2 Signed-off-by: Michael Jeanson Signed-off-by: Jérémie Galarneau --- diff --git a/src/common/compat/fcntl.h b/src/common/compat/fcntl.h index 5e566e500..9fca7f0cd 100644 --- a/src/common/compat/fcntl.h +++ b/src/common/compat/fcntl.h @@ -37,8 +37,11 @@ extern int compat_sync_file_range(int fd, off64_t offset, off64_t nbytes, #define SYNC_FILE_RANGE_WAIT_BEFORE 0 #define SYNC_FILE_RANGE_WRITE 0 -static inline int lttng_sync_file_range(int fd, off64_t offset, - off64_t nbytes, unsigned int flags) +static inline int lttng_sync_file_range( + int fd __attribute__((unused)), + off64_t offset __attribute__((unused)), + off64_t nbytes __attribute__((unused)), + unsigned int flags __attribute__((unused))) { return -ENOSYS; } @@ -53,8 +56,13 @@ static inline int lttng_sync_file_range(int fd, off64_t offset, #define SPLICE_F_MORE 0 #define SPLICE_F_GIFT 0 -static inline ssize_t splice(int fd_in, loff_t *off_in, int fd_out, loff_t *off_out, - size_t len, unsigned int flags) +static inline ssize_t splice( + int fd_in __attribute__((unused)), + loff_t *off_in __attribute__((unused)), + int fd_out __attribute__((unused)), + loff_t *off_out __attribute__((unused)), + size_t len __attribute__((unused)), + unsigned int flags __attribute__((unused))) { return -ENOSYS; } diff --git a/src/common/compat/poll.h b/src/common/compat/poll.h index f9fb33fc9..cc2aab8f8 100644 --- a/src/common/compat/poll.h +++ b/src/common/compat/poll.h @@ -354,7 +354,8 @@ extern int compat_poll_set_max_size(void); /* * No need to reset a pollfd structure for poll(2) */ -static inline void lttng_poll_reset(struct lttng_poll_event *events) +static inline void lttng_poll_reset( + struct lttng_poll_event *events __attribute__((unused))) {} /* diff --git a/src/common/fd-tracker/utils-poll.cpp b/src/common/fd-tracker/utils-poll.cpp index b1370c55d..6ea088c03 100644 --- a/src/common/fd-tracker/utils-poll.cpp +++ b/src/common/fd-tracker/utils-poll.cpp @@ -73,17 +73,19 @@ int fd_tracker_util_poll_clean( * The epoll variant of the poll compat layer creates an unsuspendable fd which * must be tracked. */ -int fd_tracker_util_poll_create(struct fd_tracker *tracker, - const char *name, +int fd_tracker_util_poll_create( + struct fd_tracker *tracker __attribute__((unused)), + const char *name __attribute__((unused)), struct lttng_poll_event *events, int size, - int flags) + int flags __attribute__((unused))) { return lttng_poll_create(events, size, flags); } int fd_tracker_util_poll_clean( - struct fd_tracker *tracker, struct lttng_poll_event *events) + struct fd_tracker *tracker __attribute__((unused)), + struct lttng_poll_event *events) { lttng_poll_clean(events); return 0; diff --git a/src/common/runas.cpp b/src/common/runas.cpp index ee3451321..eae650ba5 100644 --- a/src/common/runas.cpp +++ b/src/common/runas.cpp @@ -629,16 +629,18 @@ end: } #else static -int _extract_elf_symbol_offset(struct run_as_data *data, - struct run_as_ret *ret_value) +int _extract_elf_symbol_offset( + struct run_as_data *data __attribute__((unused)), + struct run_as_ret *ret_value __attribute__((unused))) { ERR("Unimplemented runas command RUN_AS_EXTRACT_ELF_SYMBOL_OFFSET"); return -1; } static -int _extract_sdt_probe_offsets(struct run_as_data *data, - struct run_as_ret *ret_value) +int _extract_sdt_probe_offsets( + struct run_as_data *data __attribute__((unused)), + struct run_as_ret *ret_value __attribute__((unused))) { ERR("Unimplemented runas command RUN_AS_EXTRACT_SDT_PROBE_OFFSETS"); return -1; diff --git a/src/common/unix.cpp b/src/common/unix.cpp index beeb69572..4861b8ea1 100644 --- a/src/common/unix.cpp +++ b/src/common/unix.cpp @@ -1150,7 +1150,7 @@ int lttcomm_setsockopt_creds_unix_sock(int sock) return ret; } #elif (defined(__FreeBSD__) || defined(__sun__) || defined(__APPLE__)) -int lttcomm_setsockopt_creds_unix_sock(int sock) +int lttcomm_setsockopt_creds_unix_sock(int sock __attribute__((unused))) { return 0; }