From ecd7492f21a492b70569d5ecc1d3a808241b63f0 Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Wed, 9 Mar 2022 17:52:21 -0500 Subject: [PATCH] configure: re-enable '-Wunused-parameter' This warning is part of '-Wextra' in GCC. Change-Id: Ifb514a41cb9c62cf703d415eeb2ccefc331dee77 Signed-off-by: Michael Jeanson Reviewed-on: https://review.lttng.org/c/babeltrace/+/7559 Tested-by: jenkins Reviewed-by: Philippe Proulx --- configure.ac | 1 - src/bindings/python/bt2/Makefile.am | 1 + src/cli/babeltrace2.c | 10 +++-- src/common/common.c | 8 ++-- src/common/common.h | 9 +++- src/compat/memstream.h | 11 +++-- src/compat/mman.c | 6 +-- src/compat/mman.h | 2 +- src/compat/socket.h | 10 ++++- src/ctf-writer/event.c | 4 +- src/ctf-writer/field-wrapper.c | 3 +- src/ctf-writer/fields.h | 9 +++- src/ctf-writer/resolve.c | 3 +- src/ctf-writer/trace.c | 8 ++-- src/ctf-writer/values.c | 10 +++-- src/lib/graph/component-class-sink-simple.c | 5 ++- src/lib/graph/component-filter.c | 5 ++- src/lib/graph/component-sink.c | 5 ++- src/lib/graph/component-source.c | 5 ++- src/lib/graph/graph.c | 6 +-- src/lib/graph/iterator.c | 7 +-- src/lib/lib-logging.c | 25 ++++++----- src/lib/plugin/plugin-so.c | 2 +- src/lib/plugin/plugin.c | 3 +- src/lib/prio-heap/prio-heap.h | 2 +- src/lib/trace-ir/clock-class.c | 2 +- src/lib/trace-ir/event-class.c | 2 +- src/lib/trace-ir/field-class.c | 5 ++- src/lib/trace-ir/field-wrapper.c | 2 +- src/lib/trace-ir/stream-class.c | 2 +- src/lib/trace-ir/stream.c | 3 +- src/lib/trace-ir/utils.h | 3 +- src/lib/value.c | 10 +++-- src/plugins/ctf/common/metadata/Makefile.am | 3 +- src/plugins/ctf/common/metadata/ast.hpp | 11 ++++- .../ctf/common/metadata/ctf-meta-resolve.cpp | 2 +- .../common/metadata/ctf-meta-translate.cpp | 6 +-- src/plugins/ctf/common/metadata/ctf-meta.hpp | 2 +- .../metadata/visitor-semantic-validator.cpp | 6 +-- src/plugins/ctf/fs-sink/fs-sink-stream.cpp | 2 +- src/plugins/ctf/fs-sink/fs-sink.cpp | 4 +- .../ctf/fs-sink/translate-ctf-ir-to-tsdl.cpp | 2 +- src/plugins/ctf/fs-src/data-stream-file.cpp | 2 +- src/plugins/ctf/fs-src/fs.cpp | 8 ++-- src/plugins/ctf/fs-src/metadata.cpp | 2 +- src/plugins/ctf/lttng-live/lttng-live.cpp | 10 ++--- src/plugins/ctf/lttng-live/metadata.cpp | 2 +- .../lttng-utils/debug-info/debug-info.c | 9 ++-- src/plugins/text/details/details.c | 7 +-- src/plugins/text/details/write.c | 4 +- src/plugins/text/dmesg/dmesg.c | 9 ++-- src/plugins/text/pretty/pretty.c | 4 +- src/plugins/utils/counter/counter.c | 4 +- src/plugins/utils/dummy/dummy.c | 4 +- src/plugins/utils/muxer/muxer.c | 11 ++--- src/plugins/utils/trimmer/trimmer.c | 10 +++-- tests/lib/conds/conds-triggers.cpp | 2 +- tests/lib/test-bt-uuid.c | 2 +- tests/lib/test-bt-values.c | 3 +- tests/lib/test-graph-topo.c | 25 ++++++----- tests/lib/test-plugin-plugins/minimal.c | 3 +- tests/lib/test-plugin-plugins/sfs.c | 34 +++++++------- ...ruction-listener-in-destruction-listener.c | 44 ++++++++++++------- tests/lib/test-simple-sink.c | 12 ++--- tests/lib/test-trace-ir-ref.c | 14 +++--- .../param-validation/test-param-validation.c | 4 +- tests/utils/common.c | 6 ++- tests/utils/tap/tap.c | 4 +- 68 files changed, 279 insertions(+), 187 deletions(-) diff --git a/configure.ac b/configure.ac index 90ce3d20..c72e8762 100644 --- a/configure.ac +++ b/configure.ac @@ -746,7 +746,6 @@ m4_define([WARN_FLAGS_LIST], [ dnl -Wduplicated-branches dnl -Wlogical-op dnl -Wsuggest-override dnl - -Wno-unused-parameter dnl -Wno-sign-compare dnl dnl dnl Some versions of SWIG (like 3.0.12) generate code that produces diff --git a/src/bindings/python/bt2/Makefile.am b/src/bindings/python/bt2/Makefile.am index 4be84144..edbf95b4 100644 --- a/src/bindings/python/bt2/Makefile.am +++ b/src/bindings/python/bt2/Makefile.am @@ -124,6 +124,7 @@ WARN_CFLAGS += -Wno-redundant-decls # For SWIG generated code WARN_CFLAGS += -Wno-missing-field-initializers +WARN_CFLAGS += -Wno-unused-parameter BUILD_FLAGS=CC="$(CC)" \ CFLAGS="$(GLIB_CFLAGS) $(AM_CFLAGS) $(CFLAGS) $(WARN_CFLAGS)" \ diff --git a/src/cli/babeltrace2.c b/src/cli/babeltrace2.c index bf6c49d5..6b60ff6f 100644 --- a/src/cli/babeltrace2.c +++ b/src/cli/babeltrace2.c @@ -59,7 +59,7 @@ static bt_interrupter *the_interrupter; #include static -BOOL WINAPI signal_handler(DWORD signal) { +BOOL WINAPI signal_handler(DWORD signal __attribute__((unused))) { if (the_interrupter) { bt_interrupter_set(the_interrupter); } @@ -253,7 +253,9 @@ end: static bt_value_map_foreach_entry_const_func_status collect_map_keys( - const char *key, const bt_value *object, void *data) + const char *key, + const bt_value *object __attribute__((unused)), + void *data) { GPtrArray *map_keys = data; @@ -1647,7 +1649,7 @@ end: static bt_graph_listener_func_status graph_source_output_port_added_listener( - const bt_component_source *component, + const bt_component_source *component __attribute__((unused)), const bt_port_output *port, void *data) { return graph_output_port_added_listener(data, port); @@ -1655,7 +1657,7 @@ bt_graph_listener_func_status graph_source_output_port_added_listener( static bt_graph_listener_func_status graph_filter_output_port_added_listener( - const bt_component_filter *component, + const bt_component_filter *component __attribute__((unused)), const bt_port_output *port, void *data) { return graph_output_port_added_listener(data, port); diff --git a/src/common/common.c b/src/common/common.c index 0cdc1739..b0d04877 100644 --- a/src/common/common.c +++ b/src/common/common.c @@ -240,7 +240,7 @@ bool bt_common_is_setuid_setgid(void) #ifdef __MINGW32__ static -const char *bt_get_home_dir(int log_level) +const char *bt_get_home_dir(int log_level __attribute__((unused))) { return g_get_home_dir(); } @@ -1246,7 +1246,8 @@ end_of_pattern: } #ifdef __MINGW32__ -GString *bt_common_normalize_path(const char *path, const char *wd) +GString *bt_common_normalize_path(const char *path, + const char *wd __attribute__((unused))) { char *tmp; GString *norm_path = NULL; @@ -1940,7 +1941,8 @@ end: } #ifdef __MINGW32__ -int bt_common_get_term_size(unsigned int *width, unsigned int *height) +int bt_common_get_term_size(unsigned int *width __attribute__((unused)), + unsigned int *height __attribute__((unused))) { /* Not supported on Windows yet */ return -1; diff --git a/src/common/common.h b/src/common/common.h index b447ec88..1da6b3c2 100644 --- a/src/common/common.h +++ b/src/common/common.h @@ -378,13 +378,20 @@ int bt_common_append_file_content_to_g_string(GString *str, FILE *fp); void bt_common_abort(void) __attribute__((noreturn)); +#if (!defined(BT_LOG_WRITE_CUR_LVL) && !defined(BT_LOG_WRITE_ERRNO_CUR_LVL)) +#define BT_LOG_LEVEL_UNUSED_ATTR __attribute__((unused)) +#else +#define BT_LOG_LEVEL_UNUSED_ATTR +#endif + /* * Wraps read() function to handle EINTR and partial reads. * On success, it returns `count` received as parameter. On error, it returns a * value smaller than the requested `count`. */ static inline -ssize_t bt_common_read(int fd, void *buf, size_t count, int log_level) +ssize_t bt_common_read(int fd, void *buf, size_t count, + int log_level BT_LOG_LEVEL_UNUSED_ATTR) { size_t i = 0; ssize_t ret; diff --git a/src/compat/memstream.h b/src/compat/memstream.h index dcadf048..374a5e72 100644 --- a/src/compat/memstream.h +++ b/src/compat/memstream.h @@ -174,7 +174,10 @@ FILE *bt_open_memstream(char **ptr, size_t *sizeloc) } static inline -int bt_close_memstream(char **buf, size_t *size, FILE *fp) +int bt_close_memstream( + char **buf __attribute__((unused)), + size_t *size __attribute__((unused)), + FILE *fp) { return fclose(fp); } @@ -194,7 +197,8 @@ int bt_close_memstream(char **buf, size_t *size, FILE *fp) * into the buffer (which we allocate). */ static inline -FILE *bt_open_memstream(char **ptr, size_t *sizeloc) +FILE *bt_open_memstream(char **ptr __attribute__((unused)), + size_t *sizeloc __attribute__((unused))) { char *tmpname; FILE *fp; @@ -233,7 +237,8 @@ error_free: * into the buffer (which we allocate). */ static inline -FILE *bt_open_memstream(char **ptr, size_t *sizeloc) +FILE *bt_open_memstream(char **ptr __attribute__((unused)), + size_t *sizeloc __attribute__((unused))) { char *tmpname; int ret; diff --git a/src/compat/mman.c b/src/compat/mman.c index e8eea876..1cc1c44c 100644 --- a/src/compat/mman.c +++ b/src/compat/mman.c @@ -152,8 +152,8 @@ DWORD map_prot_flags(int prot, DWORD *dwDesiredAccess) return 0; } -void *bt_mmap(void *addr, size_t length, int prot, int flags, int fd, - off_t offset, int log_level) +void *bt_mmap(void *addr __attribute__((unused)), size_t length, int prot, + int flags, int fd, off_t offset, int log_level) { struct mmap_mapping *mapping = NULL; void *mapping_addr; @@ -252,7 +252,7 @@ error: return MAP_FAILED; } -int bt_munmap(void *addr, size_t length) +int bt_munmap(void *addr, size_t length __attribute__((unused))) { int ret = 0; struct mmap_mapping *mapping = addr; diff --git a/src/compat/mman.h b/src/compat/mman.h index 0053e307..5aaab760 100644 --- a/src/compat/mman.h +++ b/src/compat/mman.h @@ -48,7 +48,7 @@ BT_EXTERN_C size_t bt_mmap_get_offset_align_size(int log_level); static inline void *bt_mmap(void *addr, size_t length, int prot, int flags, int fd, - off_t offset, int log_level) + off_t offset, int log_level __attribute__((unused))) { return (void *) mmap(addr, length, prot, flags, fd, offset); } diff --git a/src/compat/socket.h b/src/compat/socket.h index 7a57678b..7452990f 100644 --- a/src/compat/socket.h +++ b/src/compat/socket.h @@ -18,8 +18,14 @@ #define BT_SOCKET_ERROR SOCKET_ERROR #define BT_SOCKET SOCKET +#ifndef BT_LOG_WRITE_CUR_LVL +#define BT_SOCKET_LOG_LEVEL_UNUSED_ATTR __attribute__((unused)) +#else +#define BT_SOCKET_LOG_LEVEL_UNUSED_ATTR +#endif + static inline -int bt_socket_init(int log_level) +int bt_socket_init(int log_level BT_SOCKET_LOG_LEVEL_UNUSED_ATTR) { WORD verreq; WSADATA wsa; @@ -273,7 +279,7 @@ const char *bt_socket_errormsg(void) #define BT_SOCKET int static inline -int bt_socket_init(int log_level) +int bt_socket_init(int log_level __attribute__((unused))) { return 0; } diff --git a/src/ctf-writer/event.c b/src/ctf-writer/event.c index a1486aba..3b676856 100644 --- a/src/ctf-writer/event.c +++ b/src/ctf-writer/event.c @@ -519,7 +519,7 @@ int map_clock_classes_func(struct bt_ctf_stream_class_common *stream_class, static void destroy_event_header_field(struct bt_ctf_field_wrapper *field_wrapper, - struct bt_ctf_stream_class *stream_class) + struct bt_ctf_stream_class *stream_class __attribute__((unused))) { BT_ASSERT_DBG(field_wrapper); bt_ctf_object_put_ref(field_wrapper->field); @@ -561,7 +561,7 @@ end: static void release_event_header_field(struct bt_ctf_field_wrapper *field_wrapper, - struct bt_ctf_event_common *event_common) + struct bt_ctf_event_common *event_common __attribute__((unused))) { BT_ASSERT_DBG(field_wrapper); BT_CTF_OBJECT_PUT_REF_AND_RESET(field_wrapper->field); diff --git a/src/ctf-writer/field-wrapper.c b/src/ctf-writer/field-wrapper.c index 0adc54e9..c801de4b 100644 --- a/src/ctf-writer/field-wrapper.c +++ b/src/ctf-writer/field-wrapper.c @@ -13,7 +13,8 @@ #include "field-wrapper.h" #include "object.h" -struct bt_ctf_field_wrapper *bt_ctf_field_wrapper_new(void *data) +struct bt_ctf_field_wrapper *bt_ctf_field_wrapper_new( + void *data __attribute__((unused))) { struct bt_ctf_field_wrapper *field_wrapper = g_new0(struct bt_ctf_field_wrapper, 1); diff --git a/src/ctf-writer/fields.h b/src/ctf-writer/fields.h index 3893f911..768be510 100644 --- a/src/ctf-writer/fields.h +++ b/src/ctf-writer/fields.h @@ -795,8 +795,15 @@ int bt_ctf_field_structure_set_field_by_name(struct bt_ctf_field *field, struct bt_ctf_field *bt_ctf_field_enumeration_borrow_container( struct bt_ctf_field *field); +#ifndef BT_DEV_MODE +#define BT_FIELD_UNUSED_ATTR __attribute__((unused)) +#else +#define BT_FIELD_UNUSED_ATTR +#endif + static inline -bt_ctf_bool bt_ctf_field_is_set_recursive(struct bt_ctf_field *field) +bt_ctf_bool bt_ctf_field_is_set_recursive( + struct bt_ctf_field *field BT_FIELD_UNUSED_ATTR) { return bt_ctf_field_common_is_set_recursive((void *) field); } diff --git a/src/ctf-writer/resolve.c b/src/ctf-writer/resolve.c index 2ceaba33..578af1c5 100644 --- a/src/ctf-writer/resolve.c +++ b/src/ctf-writer/resolve.c @@ -278,7 +278,8 @@ end: * Destroys a path token. */ static -void ptokens_destroy_func(gpointer ptoken, gpointer data) +void ptokens_destroy_func(gpointer ptoken, + gpointer data __attribute__((unused))) { g_string_free(ptoken, TRUE); } diff --git a/src/ctf-writer/trace.c b/src/ctf-writer/trace.c index ff13f9c3..ba0e0ed5 100644 --- a/src/ctf-writer/trace.c +++ b/src/ctf-writer/trace.c @@ -576,8 +576,9 @@ end: } static -bool packet_context_field_type_is_valid(struct bt_ctf_trace_common *trace, - struct bt_ctf_stream_class_common *stream_class, +bool packet_context_field_type_is_valid( + struct bt_ctf_trace_common *trace __attribute__((unused)), + struct bt_ctf_stream_class_common *stream_class __attribute__((unused)), struct bt_ctf_field_type_common *packet_context_type, bool check_ts_begin_end_mapped) { @@ -746,7 +747,8 @@ end: } static -bool event_header_field_type_is_valid(struct bt_ctf_trace_common *trace, +bool event_header_field_type_is_valid( + struct bt_ctf_trace_common *trace __attribute__((unused)), struct bt_ctf_stream_class_common *stream_class, struct bt_ctf_field_type_common *event_header_type) { diff --git a/src/ctf-writer/values.c b/src/ctf-writer/values.c index f6cc21b0..a6ba5fc9 100644 --- a/src/ctf-writer/values.c +++ b/src/ctf-writer/values.c @@ -152,7 +152,8 @@ void (* const destroy_funcs[])(struct bt_ctf_value *) = { }; static -struct bt_ctf_private_value *bt_ctf_value_null_copy(const struct bt_ctf_value *null_obj) +struct bt_ctf_private_value *bt_ctf_value_null_copy( + const struct bt_ctf_value *null_obj __attribute__((unused))) { return (void *) bt_ctf_value_null; } @@ -303,8 +304,9 @@ struct bt_ctf_private_value *(* const copy_funcs[])(const struct bt_ctf_value *) }; static -bt_ctf_bool bt_ctf_value_null_compare(const struct bt_ctf_value *object_a, - const struct bt_ctf_value *object_b) +bt_ctf_bool bt_ctf_value_null_compare( + const struct bt_ctf_value *object_a __attribute__((unused)), + const struct bt_ctf_value *object_b __attribute__((unused))) { /* * Always BT_CTF_TRUE since bt_ctf_value_compare() already checks if both @@ -477,7 +479,7 @@ bt_ctf_bool (* const compare_funcs[])(const struct bt_ctf_value *, }; static -void bt_ctf_value_null_freeze(struct bt_ctf_value *object) +void bt_ctf_value_null_freeze(struct bt_ctf_value *object __attribute__((unused))) { } diff --git a/src/lib/graph/component-class-sink-simple.c b/src/lib/graph/component-class-sink-simple.c index b7c18361..801ddc62 100644 --- a/src/lib/graph/component-class-sink-simple.c +++ b/src/lib/graph/component-class-sink-simple.c @@ -45,8 +45,9 @@ void simple_sink_data_destroy(struct simple_sink_data *data) static enum bt_component_class_initialize_method_status simple_sink_init( bt_self_component_sink *self_comp, - bt_self_component_sink_configuration *config, - const struct bt_value *params, void *init_method_data) + bt_self_component_sink_configuration *config __attribute__((unused)), + const struct bt_value *params __attribute__((unused)), + void *init_method_data) { int status = BT_FUNC_STATUS_OK; struct simple_sink_data *data = NULL; diff --git a/src/lib/graph/component-filter.c b/src/lib/graph/component-filter.c index 79e57745..db8dfc4c 100644 --- a/src/lib/graph/component-filter.c +++ b/src/lib/graph/component-filter.c @@ -21,12 +21,13 @@ #include "component-class.h" #include "lib/func-status.h" -void bt_component_filter_destroy(struct bt_component *component) +void bt_component_filter_destroy( + struct bt_component *component __attribute__((unused))) { } struct bt_component *bt_component_filter_create( - const struct bt_component_class *class) + const struct bt_component_class *class __attribute__((unused))) { struct bt_component_filter *filter = NULL; diff --git a/src/lib/graph/component-sink.c b/src/lib/graph/component-sink.c index 37eda35a..4f087dda 100644 --- a/src/lib/graph/component-sink.c +++ b/src/lib/graph/component-sink.c @@ -21,12 +21,13 @@ #include "graph.h" #include "lib/func-status.h" -void bt_component_sink_destroy(struct bt_component *component) +void bt_component_sink_destroy( + struct bt_component *component __attribute__((unused))) { } struct bt_component *bt_component_sink_create( - const struct bt_component_class *class) + const struct bt_component_class *class __attribute__((unused))) { struct bt_component_sink *sink = NULL; diff --git a/src/lib/graph/component-source.c b/src/lib/graph/component-source.c index 83f1ef69..caeb1e0b 100644 --- a/src/lib/graph/component-source.c +++ b/src/lib/graph/component-source.c @@ -21,12 +21,13 @@ #include "message/iterator.h" #include "lib/func-status.h" -void bt_component_source_destroy(struct bt_component *component) +void bt_component_source_destroy( + struct bt_component *component __attribute__((unused))) { } struct bt_component *bt_component_source_create( - const struct bt_component_class *class) + const struct bt_component_class *class __attribute__((unused))) { struct bt_component_source *source = NULL; diff --git a/src/lib/graph/graph.c b/src/lib/graph/graph.c index 08d8846d..4290039f 100644 --- a/src/lib/graph/graph.c +++ b/src/lib/graph/graph.c @@ -145,21 +145,21 @@ void destroy_graph(struct bt_object *obj) static void destroy_message_event(struct bt_message *msg, - struct bt_graph *graph) + struct bt_graph *graph __attribute__((unused))) { bt_message_event_destroy(msg); } static void destroy_message_packet_begin(struct bt_message *msg, - struct bt_graph *graph) + struct bt_graph *graph __attribute__((unused))) { bt_message_packet_destroy(msg); } static void destroy_message_packet_end(struct bt_message *msg, - struct bt_graph *graph) + struct bt_graph *graph __attribute__((unused))) { bt_message_packet_destroy(msg); } diff --git a/src/lib/graph/iterator.c b/src/lib/graph/iterator.c index 588d0b40..9bcbab55 100644 --- a/src/lib/graph/iterator.c +++ b/src/lib/graph/iterator.c @@ -251,8 +251,9 @@ void bt_message_iterator_set_connection( static enum bt_message_iterator_can_seek_beginning_status can_seek_ns_from_origin_true( - struct bt_message_iterator *iterator, - int64_t ns_from_origin, bt_bool *can_seek) + struct bt_message_iterator *iterator __attribute__((unused)), + int64_t ns_from_origin __attribute__((unused)), + bt_bool *can_seek) { *can_seek = BT_TRUE; @@ -261,7 +262,7 @@ enum bt_message_iterator_can_seek_beginning_status can_seek_ns_from_origin_true( static enum bt_message_iterator_can_seek_beginning_status can_seek_beginning_true( - struct bt_message_iterator *iterator, + struct bt_message_iterator *iterator __attribute__((unused)), bt_bool *can_seek) { *can_seek = BT_TRUE; diff --git a/src/lib/lib-logging.c b/src/lib/lib-logging.c index b0b3488b..95b1cebb 100644 --- a/src/lib/lib-logging.c +++ b/src/lib/lib-logging.c @@ -114,7 +114,7 @@ static inline void format_clock_snapshot(char **buf_ch, bool extended, static inline void format_field_path(char **buf_ch, bool extended, const char *prefix, const struct bt_field_path *field_path); -static inline void format_object(char **buf_ch, bool extended, +static inline void format_object(char **buf_ch, bool extended __attribute__((unused)), const char *prefix, const struct bt_object *obj) { BUF_APPEND(", %sref-count=%llu", prefix, obj->ref_count); @@ -125,7 +125,7 @@ static inline void format_uuid(char **buf_ch, bt_uuid uuid) BUF_APPEND("\"" BT_UUID_FMT "\"", BT_UUID_FMT_VALUES(uuid)); } -static inline void format_object_pool(char **buf_ch, bool extended, +static inline void format_object_pool(char **buf_ch, bool extended __attribute__((unused)), const char *prefix, const struct bt_object_pool *pool) { BUF_APPEND(", %ssize=%zu", PRFIELD(pool->size)); @@ -136,7 +136,7 @@ static inline void format_object_pool(char **buf_ch, bool extended, } static inline void format_integer_field_class(char **buf_ch, - bool extended, const char *prefix, + bool extended __attribute__((unused)), const char *prefix, const struct bt_field_class *field_class) { const struct bt_field_class_integer *int_fc = @@ -148,7 +148,7 @@ static inline void format_integer_field_class(char **buf_ch, } static inline void format_array_field_class(char **buf_ch, - bool extended, const char *prefix, + bool extended __attribute__((unused)), const char *prefix, const struct bt_field_class *field_class) { const struct bt_field_class_array *array_fc = @@ -843,7 +843,8 @@ static inline void format_clock_snapshot(char **buf_ch, bool extended, } } -static inline void format_interrupter(char **buf_ch, bool extended, +static inline void format_interrupter(char **buf_ch, + bool extended __attribute__((unused)), const char *prefix, const struct bt_interrupter *intr) { BUF_APPEND(", %sis-set=%d", PRFIELD(intr->is_set)); @@ -1183,9 +1184,11 @@ static inline void format_graph(char **buf_ch, bool extended, &graph->packet_end_msg_pool); } -static inline void format_message_iterator_class(char **buf_ch, - bool extended, const char *prefix, - const struct bt_message_iterator_class *iterator_class) +static inline void format_message_iterator_class( + char **buf_ch __attribute__((unused)), + bool extended __attribute__((unused)), + const char *prefix __attribute__((unused)), + const struct bt_message_iterator_class *iterator_class __attribute__((unused))) { /* Empty, the address is automatically printed. */ } @@ -1342,8 +1345,10 @@ static inline void format_error_cause(char **buf_ch, bool extended, } } -static inline void handle_conversion_specifier_bt(void *priv_data, - char **buf_ch, size_t avail_size, +static inline void handle_conversion_specifier_bt( + void *priv_data __attribute__((unused)), + char **buf_ch, + size_t avail_size __attribute__((unused)), const char **out_fmt_ch, va_list *args) { const char *fmt_ch = *out_fmt_ch; diff --git a/src/lib/plugin/plugin-so.c b/src/lib/plugin/plugin-so.c index 6cb14080..7887a21c 100644 --- a/src/lib/plugin/plugin-so.c +++ b/src/lib/plugin/plugin-so.c @@ -1662,7 +1662,7 @@ end: static void plugin_comp_class_destroy_listener(struct bt_component_class *comp_class, - void *data) + void *data __attribute__((unused))) { bt_list_del(&comp_class->node); BT_OBJECT_PUT_REF_AND_RESET(comp_class->so_handle); diff --git a/src/lib/plugin/plugin.c b/src/lib/plugin/plugin.c index 547859f8..3287f662 100644 --- a/src/lib/plugin/plugin.c +++ b/src/lib/plugin/plugin.c @@ -515,7 +515,8 @@ static struct { static int nftw_append_all_from_dir(const char *file, - const struct stat *sb, int flag, struct FTW *s) + const struct stat *sb __attribute__((unused)), + int flag, struct FTW *s) { int ret = 0; const char *name = file + s->base; diff --git a/src/lib/prio-heap/prio-heap.h b/src/lib/prio-heap/prio-heap.h index 08ae757a..06f72a11 100644 --- a/src/lib/prio-heap/prio-heap.h +++ b/src/lib/prio-heap/prio-heap.h @@ -23,7 +23,7 @@ struct ptr_heap { void check_heap(const struct ptr_heap *heap); #else static inline -void check_heap(const struct ptr_heap *heap) +void check_heap(const struct ptr_heap *heap __attribute__((unused))) { } #endif diff --git a/src/lib/trace-ir/clock-class.c b/src/lib/trace-ir/clock-class.c index b4e15009..aee031d5 100644 --- a/src/lib/trace-ir/clock-class.c +++ b/src/lib/trace-ir/clock-class.c @@ -54,7 +54,7 @@ void destroy_clock_class(struct bt_object *obj) static void free_clock_snapshot(struct bt_clock_snapshot *clock_snapshot, - struct bt_clock_class *clock_class) + struct bt_clock_class *clock_class __attribute__((unused))) { bt_clock_snapshot_destroy(clock_snapshot); } diff --git a/src/lib/trace-ir/event-class.c b/src/lib/trace-ir/event-class.c index 1ba9a1ae..463e5ee3 100644 --- a/src/lib/trace-ir/event-class.c +++ b/src/lib/trace-ir/event-class.c @@ -66,7 +66,7 @@ void destroy_event_class(struct bt_object *obj) static void free_event(struct bt_event *event, - struct bt_event_class *event_class) + struct bt_event_class *event_class __attribute__((unused))) { bt_event_destroy(event); } diff --git a/src/lib/trace-ir/field-class.c b/src/lib/trace-ir/field-class.c index 753643f3..1990a690 100644 --- a/src/lib/trace-ir/field-class.c +++ b/src/lib/trace-ir/field-class.c @@ -253,8 +253,9 @@ uint64_t bt_field_class_integer_get_field_value_range( } static -bool size_is_valid_for_enumeration_field_class(struct bt_field_class *fc, - uint64_t size) +bool size_is_valid_for_enumeration_field_class( + struct bt_field_class *fc __attribute__((unused)), + uint64_t size __attribute__((unused))) { // TODO return true; diff --git a/src/lib/trace-ir/field-wrapper.c b/src/lib/trace-ir/field-wrapper.c index 99e99c5b..b9eee670 100644 --- a/src/lib/trace-ir/field-wrapper.c +++ b/src/lib/trace-ir/field-wrapper.c @@ -14,7 +14,7 @@ #include "field-wrapper.h" #include "field.h" -struct bt_field_wrapper *bt_field_wrapper_new(void *data) +struct bt_field_wrapper *bt_field_wrapper_new(void *data __attribute__((unused))) { struct bt_field_wrapper *field_wrapper = g_new0(struct bt_field_wrapper, 1); diff --git a/src/lib/trace-ir/stream-class.c b/src/lib/trace-ir/stream-class.c index 43551b71..07c12afe 100644 --- a/src/lib/trace-ir/stream-class.c +++ b/src/lib/trace-ir/stream-class.c @@ -67,7 +67,7 @@ void destroy_stream_class(struct bt_object *obj) static void free_field_wrapper(struct bt_field_wrapper *field_wrapper, - struct bt_stream_class *stream_class) + struct bt_stream_class *stream_class __attribute__((unused))) { bt_field_wrapper_destroy((void *) field_wrapper); } diff --git a/src/lib/trace-ir/stream.c b/src/lib/trace-ir/stream.c index 269fc72a..f85b4b23 100644 --- a/src/lib/trace-ir/stream.c +++ b/src/lib/trace-ir/stream.c @@ -52,7 +52,8 @@ void destroy_stream(struct bt_object *obj) } static -void bt_stream_free_packet(struct bt_packet *packet, struct bt_stream *stream) +void bt_stream_free_packet(struct bt_packet *packet, + struct bt_stream *stream __attribute__((unused))) { bt_packet_destroy(packet); } diff --git a/src/lib/trace-ir/utils.h b/src/lib/trace-ir/utils.h index f37d1a82..8ac74183 100644 --- a/src/lib/trace-ir/utils.h +++ b/src/lib/trace-ir/utils.h @@ -79,7 +79,8 @@ end: static inline int bt_util_ns_from_origin_inline(int64_t base_offset_ns, - int64_t offset_seconds, uint64_t offset_cycles, + int64_t offset_seconds __attribute__((unused)), + uint64_t offset_cycles __attribute__((unused)), uint64_t frequency, uint64_t value, int64_t *ns_from_origin) { int ret = 0; diff --git a/src/lib/value.c b/src/lib/value.c index 12544939..5e26fddf 100644 --- a/src/lib/value.c +++ b/src/lib/value.c @@ -267,8 +267,9 @@ struct bt_value *(* const copy_funcs[])(const struct bt_value *) = { }; static -bt_bool bt_value_null_is_equal(const struct bt_value *object_a, - const struct bt_value *object_b) +bt_bool bt_value_null_is_equal( + const struct bt_value *object_a __attribute__((unused)), + const struct bt_value *object_b __attribute__((unused))) { /* * Always BT_TRUE since bt_value_is_equal() already checks if both @@ -450,7 +451,7 @@ bt_bool (* const is_equal_funcs[])(const struct bt_value *, }; static -void bt_value_null_freeze(struct bt_value *object) +void bt_value_null_freeze(struct bt_value *object __attribute__((unused))) { } @@ -828,7 +829,8 @@ int64_t bt_value_integer_signed_get(const struct bt_value *integer_obj) static inline void set_integer_value(struct bt_value *integer_obj, - enum bt_value_type expected_type, uint64_t uval, + enum bt_value_type expected_type __attribute__((unused)), + uint64_t uval, const char *api_func) { BT_ASSERT_PRE_DEV_VALUE_HOT_FROM_FUNC(api_func, integer_obj); diff --git a/src/plugins/ctf/common/metadata/Makefile.am b/src/plugins/ctf/common/metadata/Makefile.am index 2fca29b3..d3b25e23 100644 --- a/src/plugins/ctf/common/metadata/Makefile.am +++ b/src/plugins/ctf/common/metadata/Makefile.am @@ -18,7 +18,8 @@ libctf_parser_la_CPPFLAGS = $(AM_CPPFLAGS) \ libctf_parser_la_CXXFLAGS = $(AM_CXXFLAGS) \ -Wno-unused-function \ -Wno-null-dereference \ - -Wno-missing-field-initializers + -Wno-missing-field-initializers \ + -Wno-unused-parameter libctf_ast_la_SOURCES = \ visitor-generate-ir.cpp \ diff --git a/src/plugins/ctf/common/metadata/ast.hpp b/src/plugins/ctf/common/metadata/ast.hpp index 7ac2618d..037a1e6a 100644 --- a/src/plugins/ctf/common/metadata/ast.hpp +++ b/src/plugins/ctf/common/metadata/ast.hpp @@ -414,8 +414,15 @@ error: return g_string_free(str, TRUE); } -static inline int ctf_ast_get_unary_uuid(struct bt_list_head *head, bt_uuid_t uuid, int log_level, - bt_self_component *self_comp) +#ifndef BT_COMP_LOG_CUR_LVL +#define BT_AST_LOG_LEVEL_UNUSED_ATTR __attribute__((unused)) +#else +#define BT_AST_LOG_LEVEL_UNUSED_ATTR +#endif + +static inline int ctf_ast_get_unary_uuid(struct bt_list_head *head, bt_uuid_t uuid, + int log_level BT_AST_LOG_LEVEL_UNUSED_ATTR, + bt_self_component *self_comp BT_AST_LOG_LEVEL_UNUSED_ATTR) { int i = 0; int ret = 0; diff --git a/src/plugins/ctf/common/metadata/ctf-meta-resolve.cpp b/src/plugins/ctf/common/metadata/ctf-meta-resolve.cpp index 4e977a1d..423202a9 100644 --- a/src/plugins/ctf/common/metadata/ctf-meta-resolve.cpp +++ b/src/plugins/ctf/common/metadata/ctf-meta-resolve.cpp @@ -278,7 +278,7 @@ end: /* * Destroys a path token. */ -static void ptokens_destroy_func(gpointer ptoken, gpointer data) +static void ptokens_destroy_func(gpointer ptoken, gpointer) { g_string_free((GString *) ptoken, TRUE); } diff --git a/src/plugins/ctf/common/metadata/ctf-meta-translate.cpp b/src/plugins/ctf/common/metadata/ctf-meta-translate.cpp index 09707108..6f5d2d58 100644 --- a/src/plugins/ctf/common/metadata/ctf-meta-translate.cpp +++ b/src/plugins/ctf/common/metadata/ctf-meta-translate.cpp @@ -129,7 +129,7 @@ static inline bt_field_class *ctf_field_class_float_to_ir(struct ctx *ctx, } static inline bt_field_class *ctf_field_class_string_to_ir(struct ctx *ctx, - struct ctf_field_class_string *fc) + struct ctf_field_class_string *) { bt_field_class *ir_fc = bt_field_class_string_create(ctx->ir_tc); @@ -140,8 +140,8 @@ static inline bt_field_class *ctf_field_class_string_to_ir(struct ctx *ctx, static inline void translate_struct_field_class_members(struct ctx *ctx, struct ctf_field_class_struct *fc, bt_field_class *ir_fc, - bool with_header_prefix, - struct ctf_field_class_struct *context_fc) + bool, + struct ctf_field_class_struct *) { uint64_t i; int ret; diff --git a/src/plugins/ctf/common/metadata/ctf-meta.hpp b/src/plugins/ctf/common/metadata/ctf-meta.hpp index f87b4260..24dc01a5 100644 --- a/src/plugins/ctf/common/metadata/ctf-meta.hpp +++ b/src/plugins/ctf/common/metadata/ctf-meta.hpp @@ -1304,7 +1304,7 @@ _ctf_field_class_float_copy(struct ctf_field_class_float *fc) } static inline struct ctf_field_class_string * -_ctf_field_class_string_copy(struct ctf_field_class_string *fc) +_ctf_field_class_string_copy(struct ctf_field_class_string *) { struct ctf_field_class_string *copy_fc = ctf_field_class_string_create(); diff --git a/src/plugins/ctf/common/metadata/visitor-semantic-validator.cpp b/src/plugins/ctf/common/metadata/visitor-semantic-validator.cpp index d2d084df..f219a19f 100644 --- a/src/plugins/ctf/common/metadata/visitor-semantic-validator.cpp +++ b/src/plugins/ctf/common/metadata/visitor-semantic-validator.cpp @@ -29,7 +29,7 @@ static int _ctf_visitor_semantic_check(int depth, struct ctf_node *node, struct meta_log_config *log_cfg); -static int ctf_visitor_unary_expression(int depth, struct ctf_node *node, +static int ctf_visitor_unary_expression(int, struct ctf_node *node, struct meta_log_config *log_cfg) { struct ctf_node *iter; @@ -201,7 +201,7 @@ errperm: return -EPERM; /* Structure not allowed */ } -static int ctf_visitor_field_class_specifier_list(int depth, struct ctf_node *node, +static int ctf_visitor_field_class_specifier_list(int, struct ctf_node *node, struct meta_log_config *log_cfg) { switch (node->parent->type) { @@ -243,7 +243,7 @@ errinval: return -EINVAL; /* Incoherent structure */ } -static int ctf_visitor_field_class_specifier(int depth, struct ctf_node *node, +static int ctf_visitor_field_class_specifier(int, struct ctf_node *node, struct meta_log_config *log_cfg) { switch (node->parent->type) { diff --git a/src/plugins/ctf/fs-sink/fs-sink-stream.cpp b/src/plugins/ctf/fs-sink/fs-sink-stream.cpp index 6e3bfb36..9a955a22 100644 --- a/src/plugins/ctf/fs-sink/fs-sink-stream.cpp +++ b/src/plugins/ctf/fs-sink/fs-sink-stream.cpp @@ -229,7 +229,7 @@ static inline int write_float_field(struct fs_sink_stream *stream, } static inline int write_string_field(struct fs_sink_stream *stream, - struct fs_sink_ctf_field_class_string *fc, + struct fs_sink_ctf_field_class_string *, const bt_field *field) { return bt_ctfser_write_string(&stream->ctfser, bt_field_string_get_value(field)); diff --git a/src/plugins/ctf/fs-sink/fs-sink.cpp b/src/plugins/ctf/fs-sink/fs-sink.cpp index cab1fbaa..d13f3142 100644 --- a/src/plugins/ctf/fs-sink/fs-sink.cpp +++ b/src/plugins/ctf/fs-sink/fs-sink.cpp @@ -133,8 +133,8 @@ end: bt_component_class_initialize_method_status ctf_fs_sink_init(bt_self_component_sink *self_comp_sink, - bt_self_component_sink_configuration *config, const bt_value *params, - void *init_method_data) + bt_self_component_sink_configuration *, const bt_value *params, + void *) { bt_component_class_initialize_method_status status; bt_self_component_add_port_status add_port_status; diff --git a/src/plugins/ctf/fs-sink/translate-ctf-ir-to-tsdl.cpp b/src/plugins/ctf/fs-sink/translate-ctf-ir-to-tsdl.cpp index aa85ec4e..c4224252 100644 --- a/src/plugins/ctf/fs-sink/translate-ctf-ir-to-tsdl.cpp +++ b/src/plugins/ctf/fs-sink/translate-ctf-ir-to-tsdl.cpp @@ -287,7 +287,7 @@ static void append_float_field_class(struct ctx *ctx, struct fs_sink_ctf_field_c mant_dig, exp_dig, fc->base.base.alignment); } -static void append_string_field_class(struct ctx *ctx, struct fs_sink_ctf_field_class_string *fc) +static void append_string_field_class(struct ctx *ctx, struct fs_sink_ctf_field_class_string *) { g_string_append(ctx->tsdl, "string { encoding = UTF8; }"); } diff --git a/src/plugins/ctf/fs-src/data-stream-file.cpp b/src/plugins/ctf/fs-src/data-stream-file.cpp index 3c28721f..1a49d878 100644 --- a/src/plugins/ctf/fs-src/data-stream-file.cpp +++ b/src/plugins/ctf/fs-src/data-stream-file.cpp @@ -229,7 +229,7 @@ end: return status; } -static bt_stream *medop_borrow_stream(bt_stream_class *stream_class, int64_t stream_id, void *data) +static bt_stream *medop_borrow_stream(bt_stream_class *stream_class, int64_t, void *data) { struct ctf_fs_ds_file *ds_file = (struct ctf_fs_ds_file *) data; bt_stream_class *ds_file_stream_class; diff --git a/src/plugins/ctf/fs-src/fs.cpp b/src/plugins/ctf/fs-src/fs.cpp index 04ae6d2b..0118efbd 100644 --- a/src/plugins/ctf/fs-src/fs.cpp +++ b/src/plugins/ctf/fs-src/fs.cpp @@ -327,7 +327,7 @@ static void ctf_fs_trace_destroy_notifier(void *data) } struct ctf_fs_component *ctf_fs_component_create(bt_logging_level log_level, - bt_self_component *self_comp) + bt_self_component *) { struct ctf_fs_component *ctf_fs; @@ -403,7 +403,7 @@ gchar *ctf_fs_make_port_name(struct ctf_fs_ds_file_group *ds_file_group) } static int create_one_port_for_trace(struct ctf_fs_component *ctf_fs, - struct ctf_fs_trace *ctf_fs_trace, + struct ctf_fs_trace *, struct ctf_fs_ds_file_group *ds_file_group, bt_self_component_source *self_comp_src) { @@ -2295,8 +2295,8 @@ end: } bt_component_class_initialize_method_status -ctf_fs_init(bt_self_component_source *self_comp_src, bt_self_component_source_configuration *config, - const bt_value *params, __attribute__((unused)) void *init_method_data) +ctf_fs_init(bt_self_component_source *self_comp_src, bt_self_component_source_configuration *, + const bt_value *params, void *) { struct ctf_fs_component *ctf_fs; bt_component_class_initialize_method_status ret = diff --git a/src/plugins/ctf/fs-src/metadata.cpp b/src/plugins/ctf/fs-src/metadata.cpp index 0681b6f2..5e6f7d10 100644 --- a/src/plugins/ctf/fs-src/metadata.cpp +++ b/src/plugins/ctf/fs-src/metadata.cpp @@ -123,7 +123,7 @@ end: return ret; } -int ctf_fs_metadata_init(struct ctf_fs_metadata *metadata) +int ctf_fs_metadata_init(struct ctf_fs_metadata *) { /* Nothing to initialize for the moment. */ return 0; diff --git a/src/plugins/ctf/lttng-live/lttng-live.cpp b/src/plugins/ctf/lttng-live/lttng-live.cpp index 5ff0ff3f..02900df4 100644 --- a/src/plugins/ctf/lttng-live/lttng-live.cpp +++ b/src/plugins/ctf/lttng-live/lttng-live.cpp @@ -720,7 +720,7 @@ end: return ret; } -static int live_get_msg_ts_ns(struct lttng_live_stream_iterator *stream_iter, +static int live_get_msg_ts_ns(struct lttng_live_stream_iterator *, struct lttng_live_msg_iter *lttng_live_msg_iter, const bt_message *msg, int64_t last_msg_ts_ns, int64_t *ts_ns) { @@ -1781,8 +1781,8 @@ end: bt_message_iterator_class_initialize_method_status lttng_live_msg_iter_init(bt_self_message_iterator *self_msg_it, - bt_self_message_iterator_configuration *config, - bt_self_component_port_output *self_port) + bt_self_message_iterator_configuration *, + bt_self_component_port_output *) { bt_message_iterator_class_initialize_method_status status; struct lttng_live_component *lttng_live; @@ -2173,8 +2173,8 @@ end: bt_component_class_initialize_method_status lttng_live_component_init(bt_self_component_source *self_comp_src, - bt_self_component_source_configuration *config, const bt_value *params, - __attribute__((unused)) void *init_method_data) + bt_self_component_source_configuration *, const bt_value *params, + void *) { struct lttng_live_component *lttng_live; bt_component_class_initialize_method_status ret; diff --git a/src/plugins/ctf/lttng-live/metadata.cpp b/src/plugins/ctf/lttng-live/metadata.cpp index 5c66d10f..eee28c41 100644 --- a/src/plugins/ctf/lttng-live/metadata.cpp +++ b/src/plugins/ctf/lttng-live/metadata.cpp @@ -288,7 +288,7 @@ end: } int lttng_live_metadata_create_stream(struct lttng_live_session *session, uint64_t ctf_trace_id, - uint64_t stream_id, const char *trace_name) + uint64_t stream_id, const char *) { bt_self_component *self_comp = session->self_comp; bt_logging_level log_level = session->log_level; diff --git a/src/plugins/lttng-utils/debug-info/debug-info.c b/src/plugins/lttng-utils/debug-info/debug-info.c index c1b5ff22..927ba7a8 100644 --- a/src/plugins/lttng-utils/debug-info/debug-info.c +++ b/src/plugins/lttng-utils/debug-info/debug-info.c @@ -1510,7 +1510,8 @@ end: } static -bt_message *handle_msg_iterator_inactivity(struct debug_info_msg_iter *debug_it, +bt_message *handle_msg_iterator_inactivity( + struct debug_info_msg_iter *debug_it __attribute__((unused)), const bt_message *in_message) { /* @@ -1758,8 +1759,8 @@ end: bt_component_class_initialize_method_status debug_info_comp_init( bt_self_component_filter *self_comp_flt, - bt_self_component_filter_configuration *config, - const bt_value *params, __attribute__((unused)) void *init_method_data) + bt_self_component_filter_configuration *config __attribute__((unused)), + const bt_value *params, void *init_method_data __attribute__((unused))) { struct debug_info_component *debug_info_comp; bt_component_class_initialize_method_status status = @@ -1955,7 +1956,7 @@ end: bt_message_iterator_class_initialize_method_status debug_info_msg_iter_init( bt_self_message_iterator *self_msg_iter, bt_self_message_iterator_configuration *config, - bt_self_component_port_output *self_port) + bt_self_component_port_output *self_port __attribute__((unused))) { bt_message_iterator_class_initialize_method_status status; bt_message_iterator_create_from_message_iterator_status diff --git a/src/plugins/text/details/details.c b/src/plugins/text/details/details.c index 32ddd824..550ae9d9 100644 --- a/src/plugins/text/details/details.c +++ b/src/plugins/text/details/details.c @@ -198,7 +198,8 @@ void details_finalize(bt_self_component_sink *comp) } static -void configure_bool_opt(struct details_comp *details_comp, +void configure_bool_opt( + struct details_comp *details_comp __attribute__((unused)), const bt_value *params, const char *param_name, bool default_value, bool *opt_value) { @@ -333,9 +334,9 @@ void log_configuration(bt_self_component_sink *comp, bt_component_class_initialize_method_status details_init( bt_self_component_sink *comp, - bt_self_component_sink_configuration *config, + bt_self_component_sink_configuration *config __attribute__((unused)), const bt_value *params, - __attribute__((unused)) void *init_method_data) + void *init_method_data __attribute__((unused))) { bt_component_class_initialize_method_status status; bt_self_component_add_port_status add_port_status; diff --git a/src/plugins/text/details/write.c b/src/plugins/text/details/write.c index a99599e3..1962f5df 100644 --- a/src/plugins/text/details/write.c +++ b/src/plugins/text/details/write.c @@ -361,7 +361,9 @@ gint compare_strings(const char **a, const char **b) static bt_value_map_foreach_entry_const_func_status map_value_foreach_add_key_to_array( - const char *key, const bt_value *object, void *data) + const char *key, + const bt_value *object __attribute__((unused)), + void *data) { GPtrArray *keys = data; diff --git a/src/plugins/text/dmesg/dmesg.c b/src/plugins/text/dmesg/dmesg.c index d52ddb21..d23e31be 100644 --- a/src/plugins/text/dmesg/dmesg.c +++ b/src/plugins/text/dmesg/dmesg.c @@ -361,8 +361,9 @@ void destroy_dmesg_component(struct dmesg_component *dmesg_comp) bt_component_class_initialize_method_status dmesg_init( bt_self_component_source *self_comp_src, - bt_self_component_source_configuration *config, - const bt_value *params, void *init_method_data) + bt_self_component_source_configuration *config __attribute__((unused)), + const bt_value *params, + void *init_method_data __attribute__((unused))) { struct dmesg_component *dmesg_comp = g_new0(struct dmesg_component, 1); bt_component_class_initialize_method_status status; @@ -650,8 +651,8 @@ void destroy_dmesg_msg_iter(struct dmesg_msg_iter *dmesg_msg_iter) bt_message_iterator_class_initialize_method_status dmesg_msg_iter_init( bt_self_message_iterator *self_msg_iter, - bt_self_message_iterator_configuration *config, - bt_self_component_port_output *self_port) + bt_self_message_iterator_configuration *config __attribute__((unused)), + bt_self_component_port_output *self_port __attribute__((unused))) { bt_self_component *self_comp = bt_self_message_iterator_borrow_component(self_msg_iter); diff --git a/src/plugins/text/pretty/pretty.c b/src/plugins/text/pretty/pretty.c index 510ed24e..5b665764 100644 --- a/src/plugins/text/pretty/pretty.c +++ b/src/plugins/text/pretty/pretty.c @@ -542,9 +542,9 @@ void set_use_colors(struct pretty_component *pretty) bt_component_class_initialize_method_status pretty_init( bt_self_component_sink *self_comp_sink, - bt_self_component_sink_configuration *config, + bt_self_component_sink_configuration *config __attribute__((unused)), const bt_value *params, - __attribute__((unused)) void *init_method_data) + void *init_method_data __attribute__((unused))) { bt_component_class_initialize_method_status status; bt_self_component_add_port_status add_port_status; diff --git a/src/plugins/utils/counter/counter.c b/src/plugins/utils/counter/counter.c index be20f895..817d0994 100644 --- a/src/plugins/utils/counter/counter.c +++ b/src/plugins/utils/counter/counter.c @@ -130,9 +130,9 @@ struct bt_param_validation_map_value_entry_descr counter_params[] = { bt_component_class_initialize_method_status counter_init( bt_self_component_sink *component, - bt_self_component_sink_configuration *config, + bt_self_component_sink_configuration *config __attribute__((unused)), const bt_value *params, - __attribute__((unused)) void *init_method_data) + void *init_method_data __attribute__((unused))) { bt_component_class_initialize_method_status status; bt_self_component_add_port_status add_port_status; diff --git a/src/plugins/utils/dummy/dummy.c b/src/plugins/utils/dummy/dummy.c index 93394029..a1294c3d 100644 --- a/src/plugins/utils/dummy/dummy.c +++ b/src/plugins/utils/dummy/dummy.c @@ -44,9 +44,9 @@ struct bt_param_validation_map_value_entry_descr dummy_params[] = { bt_component_class_initialize_method_status dummy_init( bt_self_component_sink *self_comp_sink, - bt_self_component_sink_configuration *config, + bt_self_component_sink_configuration *config __attribute__((unused)), const bt_value *params, - __attribute__((unused)) void *init_method_data) + void *init_method_data __attribute__((unused))) { bt_self_component *self_comp = bt_self_component_sink_as_self_component(self_comp_sink); diff --git a/src/plugins/utils/muxer/muxer.c b/src/plugins/utils/muxer/muxer.c index 49c6940f..6fe2f003 100644 --- a/src/plugins/utils/muxer/muxer.c +++ b/src/plugins/utils/muxer/muxer.c @@ -250,8 +250,9 @@ struct bt_param_validation_map_value_entry_descr muxer_params[] = { bt_component_class_initialize_method_status muxer_init( bt_self_component_filter *self_comp_flt, - bt_self_component_filter_configuration *config, - const bt_value *params, void *init_data) + bt_self_component_filter_configuration *config __attribute__((unused)), + const bt_value *params, + void *init_data __attribute__((unused))) { bt_component_class_initialize_method_status status; bt_self_component_add_port_status add_port_status; @@ -1291,7 +1292,7 @@ end: bt_message_iterator_class_initialize_method_status muxer_msg_iter_init( bt_self_message_iterator *self_msg_iter, bt_self_message_iterator_configuration *config, - bt_self_component_port_output *port) + bt_self_component_port_output *port __attribute__((unused))) { struct muxer_comp *muxer_comp = NULL; struct muxer_msg_iter *muxer_msg_iter = NULL; @@ -1440,8 +1441,8 @@ bt_message_iterator_class_next_method_status muxer_msg_iter_next( bt_component_class_port_connected_method_status muxer_input_port_connected( bt_self_component_filter *self_comp, - bt_self_component_port_input *self_port, - const bt_port_output *other_port) + bt_self_component_port_input *self_port __attribute__((unused)), + const bt_port_output *other_port __attribute__((unused))) { bt_component_class_port_connected_method_status status = BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_OK; diff --git a/src/plugins/utils/trimmer/trimmer.c b/src/plugins/utils/trimmer/trimmer.c index 31cad1c4..afb1cf48 100644 --- a/src/plugins/utils/trimmer/trimmer.c +++ b/src/plugins/utils/trimmer/trimmer.c @@ -425,7 +425,8 @@ end: */ static int set_bound_from_param(struct trimmer_comp *trimmer_comp, - const char *param_name, const bt_value *param, + const char *param_name __attribute__((unused)), + const bt_value *param, struct trimmer_bound *bound, bool is_gmt) { int ret; @@ -594,8 +595,9 @@ end: bt_component_class_initialize_method_status trimmer_init( bt_self_component_filter *self_comp_flt, - bt_self_component_filter_configuration *config, - const bt_value *params, void *init_data) + bt_self_component_filter_configuration *config __attribute__((unused)), + const bt_value *params, + void *init_data __attribute__((unused))) { bt_component_class_initialize_method_status status; bt_self_component_add_port_status add_port_status; @@ -681,7 +683,7 @@ void destroy_trimmer_iterator_stream_state( bt_message_iterator_class_initialize_method_status trimmer_msg_iter_init( bt_self_message_iterator *self_msg_iter, bt_self_message_iterator_configuration *config, - bt_self_component_port_output *port) + bt_self_component_port_output *port __attribute__((unused))) { bt_message_iterator_class_initialize_method_status status; bt_message_iterator_create_from_message_iterator_status diff --git a/tests/lib/conds/conds-triggers.cpp b/tests/lib/conds/conds-triggers.cpp index abad4ed4..c348c556 100644 --- a/tests/lib/conds/conds-triggers.cpp +++ b/tests/lib/conds/conds-triggers.cpp @@ -35,7 +35,7 @@ static void trigger_fc_int_set_field_value_range_n_gt_64(bt_self_component *self bt_field_class_integer_set_field_value_range(get_uint_fc(self_comp), 65); } -static void trigger_fc_int_set_field_value_range_null(bt_self_component *self_comp) +static void trigger_fc_int_set_field_value_range_null(bt_self_component *) { bt_field_class_integer_set_field_value_range(NULL, 23); } diff --git a/tests/lib/test-bt-uuid.c b/tests/lib/test-bt-uuid.c index 8a0b610f..56136ac5 100644 --- a/tests/lib/test-bt-uuid.c +++ b/tests/lib/test-bt-uuid.c @@ -173,7 +173,7 @@ void run_test(void) run_test_bt_uuid_generate(); } -int main(int argc, char **argv) +int main(void) { /* Run tap-formated tests */ run_test(); diff --git a/tests/lib/test-bt-values.c b/tests/lib/test-bt-values.c index cc3cbd9f..e9ec4b21 100644 --- a/tests/lib/test-bt-values.c +++ b/tests/lib/test-bt-values.c @@ -356,7 +356,8 @@ void test_array(void) static bt_value_map_foreach_entry_func_status test_map_foreach_cb_count( - const char *key, bt_value *object, + const char *key __attribute__((unused)), + bt_value *object __attribute__((unused)), void *data) { int *count = data; diff --git a/tests/lib/test-graph-topo.c b/tests/lib/test-graph-topo.c index 0a0f2bc4..3bd3f361 100644 --- a/tests/lib/test-graph-topo.c +++ b/tests/lib/test-graph-topo.c @@ -179,9 +179,10 @@ size_t event_pos(struct event *event) static bt_message_iterator_class_next_method_status src_iter_next( - bt_self_message_iterator *self_iterator, - bt_message_array_const msgs, uint64_t capacity, - uint64_t *count) + bt_self_message_iterator *self_iterator __attribute__((unused)), + bt_message_array_const msgs __attribute__((unused)), + uint64_t capacity __attribute__((unused)), + uint64_t *count __attribute__((unused))) { return BT_MESSAGE_ITERATOR_CLASS_NEXT_METHOD_STATUS_ERROR; } @@ -254,8 +255,9 @@ bt_component_class_port_connected_method_status sink_input_port_connected( static bt_component_class_initialize_method_status src_init( bt_self_component_source *self_comp, - bt_self_component_source_configuration *config, - const bt_value *params, void *init_method_data) + bt_self_component_source_configuration *config __attribute__((unused)), + const bt_value *params __attribute__((unused)), + void *init_method_data __attribute__((unused))) { int ret; @@ -268,8 +270,9 @@ bt_component_class_initialize_method_status src_init( static bt_component_class_initialize_method_status sink_init( bt_self_component_sink *self_comp, - bt_self_component_sink_configuration *config, - const bt_value *params, void *init_method_data) + bt_self_component_sink_configuration *config __attribute__((unused)), + const bt_value *params __attribute__((unused)), + void *init_method_data __attribute__((unused))) { int ret; @@ -281,7 +284,7 @@ bt_component_class_initialize_method_status sink_init( static bt_component_class_sink_consume_method_status sink_consume( - bt_self_component_sink *self_comp) + bt_self_component_sink *self_comp __attribute__((unused))) { return BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_OK; } @@ -289,7 +292,7 @@ bt_component_class_sink_consume_method_status sink_consume( static bt_graph_listener_func_status graph_src_output_port_added( const bt_component_source *comp, const bt_port_output *port, - void *data) + void *data __attribute__((unused))) { struct event event = { .type = GRAPH_SRC_OUTPUT_PORT_ADDED, @@ -307,7 +310,7 @@ bt_graph_listener_func_status graph_src_output_port_added( static bt_graph_listener_func_status graph_sink_input_port_added( const bt_component_sink *comp, const bt_port_input *port, - void *data) + void *data __attribute__((unused))) { struct event event = { .type = GRAPH_SINK_INPUT_PORT_ADDED, @@ -706,7 +709,7 @@ void test_empty_graph(void) bt_graph_put_ref(graph); } -int main(int argc, char **argv) +int main(void) { plan_tests(NR_TESTS); init_test(); diff --git a/tests/lib/test-plugin-plugins/minimal.c b/tests/lib/test-plugin-plugins/minimal.c index 693f9db5..7f9e016a 100644 --- a/tests/lib/test-plugin-plugins/minimal.c +++ b/tests/lib/test-plugin-plugins/minimal.c @@ -8,7 +8,8 @@ #include #include -static bt_plugin_initialize_func_status plugin_init(bt_self_plugin *plugin) +static bt_plugin_initialize_func_status plugin_init( + bt_self_plugin *plugin __attribute__((unused))) { g_setenv("BT_TEST_PLUGIN_INITIALIZE_CALLED", "1", 1); return BT_PLUGIN_INITIALIZE_FUNC_STATUS_OK; diff --git a/tests/lib/test-plugin-plugins/sfs.c b/tests/lib/test-plugin-plugins/sfs.c index 6fbd76dc..d0608799 100644 --- a/tests/lib/test-plugin-plugins/sfs.c +++ b/tests/lib/test-plugin-plugins/sfs.c @@ -8,16 +8,17 @@ #include "common/assert.h" static bt_component_class_sink_consume_method_status sink_consume( - bt_self_component_sink *self_comp) + bt_self_component_sink *self_comp __attribute__((unused))) { return BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_OK; } static bt_component_class_get_supported_mip_versions_method_status sink_get_supported_mip_versions( - bt_self_component_class_sink *source_component_class, - const bt_value *params, void *initialize_method_data, - bt_logging_level logging_level, + bt_self_component_class_sink *source_component_class __attribute__((unused)), + const bt_value *params __attribute__((unused)), + void *initialize_method_data __attribute__((unused)), + bt_logging_level logging_level __attribute__((unused)), bt_integer_range_set_unsigned *supported_versions) { return (int) bt_integer_range_set_unsigned_add_range( @@ -26,39 +27,40 @@ sink_get_supported_mip_versions( static bt_message_iterator_class_initialize_method_status src_dummy_iterator_init_method( - bt_self_message_iterator *self_msg_iter, - bt_self_message_iterator_configuration *config, - bt_self_component_port_output *self_port) + bt_self_message_iterator *self_msg_iter __attribute__((unused)), + bt_self_message_iterator_configuration *config __attribute__((unused)), + bt_self_component_port_output *self_port __attribute__((unused))) { return BT_MESSAGE_ITERATOR_CLASS_INITIALIZE_METHOD_STATUS_OK; } static bt_message_iterator_class_initialize_method_status flt_dummy_iterator_init_method( - bt_self_message_iterator *self_msg_iter, - bt_self_message_iterator_configuration *config, - bt_self_component_port_output *self_port) + bt_self_message_iterator *self_msg_iter __attribute__((unused)), + bt_self_message_iterator_configuration *config __attribute__((unused)), + bt_self_component_port_output *self_port __attribute__((unused))) { return BT_MESSAGE_ITERATOR_CLASS_INITIALIZE_METHOD_STATUS_OK; } static void dummy_iterator_finalize_method( - bt_self_message_iterator *self_msg_iter) + bt_self_message_iterator *self_msg_iter __attribute__((unused))) { } static bt_message_iterator_class_next_method_status dummy_iterator_next_method( - bt_self_message_iterator *self_msg_iter, - bt_message_array_const msgs, uint64_t capacity, - uint64_t *count) + bt_self_message_iterator *self_msg_iter __attribute__((unused)), + bt_message_array_const msgs __attribute__((unused)), + uint64_t capacity __attribute__((unused)), + uint64_t *count __attribute__((unused))) { return BT_MESSAGE_ITERATOR_CLASS_NEXT_METHOD_STATUS_OK; } static bt_component_class_query_method_status flt_query_method( - bt_self_component_class_filter *component_class, - bt_private_query_executor *priv_query_exec, + bt_self_component_class_filter *component_class __attribute__((unused)), + bt_private_query_executor *priv_query_exec __attribute__((unused)), const char *object, const bt_value *params, __attribute__((unused)) void *method_data, const bt_value **result) diff --git a/tests/lib/test-remove-destruction-listener-in-destruction-listener.c b/tests/lib/test-remove-destruction-listener-in-destruction-listener.c index a3827ddf..7aae2f98 100644 --- a/tests/lib/test-remove-destruction-listener-in-destruction-listener.c +++ b/tests/lib/test-remove-destruction-listener-in-destruction-listener.c @@ -41,13 +41,15 @@ static bool trace_destroyed_4_called = false; static bool trace_destroyed_5_called = false; static -void trace_class_destroyed_1(const bt_trace_class *tc, void *data) +void trace_class_destroyed_1(const bt_trace_class *tc __attribute__((unused)), + void *data __attribute__((unused))) { trace_class_destroyed_1_called = true; } static -void trace_class_destroyed_2(const bt_trace_class *tc, void *data) +void trace_class_destroyed_2(const bt_trace_class *tc, + void *data __attribute__((unused))) { bt_trace_class_remove_listener_status remove_listener_status; @@ -61,7 +63,8 @@ void trace_class_destroyed_2(const bt_trace_class *tc, void *data) } static -void trace_class_destroyed_3(const bt_trace_class *tc, void *data) +void trace_class_destroyed_3(const bt_trace_class *tc, + void *data __attribute__((unused))) { bt_trace_class_remove_listener_status remove_listener_status; @@ -75,7 +78,8 @@ void trace_class_destroyed_3(const bt_trace_class *tc, void *data) } static -void trace_class_destroyed_4(const bt_trace_class *tc, void *data) +void trace_class_destroyed_4(const bt_trace_class *tc, + void *data __attribute__((unused))) { bt_trace_class_remove_listener_status remove_listener_status; @@ -89,19 +93,22 @@ void trace_class_destroyed_4(const bt_trace_class *tc, void *data) } static -void trace_class_destroyed_5(const bt_trace_class *tc, void *data) +void trace_class_destroyed_5(const bt_trace_class *tc __attribute__((unused)), + void *data __attribute__((unused))) { trace_class_destroyed_5_called = true; } static -void trace_destroyed_1(const bt_trace *t, void *data) +void trace_destroyed_1(const bt_trace *t __attribute__((unused)), + void *data __attribute__((unused))) { trace_destroyed_1_called = true; } static -void trace_destroyed_2(const bt_trace *t, void *data) +void trace_destroyed_2(const bt_trace *t, + void *data __attribute__((unused))) { bt_trace_remove_listener_status remove_listener_status; @@ -115,7 +122,8 @@ void trace_destroyed_2(const bt_trace *t, void *data) } static -void trace_destroyed_3(const bt_trace *t, void *data) +void trace_destroyed_3(const bt_trace *t, + void *data __attribute__((unused))) { bt_trace_remove_listener_status remove_listener_status; @@ -129,7 +137,8 @@ void trace_destroyed_3(const bt_trace *t, void *data) } static -void trace_destroyed_4(const bt_trace *t, void *data) +void trace_destroyed_4(const bt_trace *t, + void *data __attribute__((unused))) { bt_trace_remove_listener_status remove_listener_status; @@ -143,7 +152,8 @@ void trace_destroyed_4(const bt_trace *t, void *data) } static -void trace_destroyed_5(const bt_trace *t, void *data) +void trace_destroyed_5(const bt_trace *t __attribute__((unused)), + void *data __attribute__((unused))) { trace_destroyed_5_called = true; } @@ -151,8 +161,9 @@ void trace_destroyed_5(const bt_trace *t, void *data) static bt_component_class_initialize_method_status hello_init( bt_self_component_source *self_component, - bt_self_component_source_configuration *config, - const bt_value *params, void *init_method_data) + bt_self_component_source_configuration *config __attribute__((unused)), + const bt_value *params __attribute__((unused)), + void *init_method_data __attribute__((unused))) { bt_self_component *self_comp; bt_trace_class *tc; @@ -230,15 +241,16 @@ bt_component_class_initialize_method_status hello_init( static bt_message_iterator_class_next_method_status hello_iter_next( - bt_self_message_iterator *message_iterator, - bt_message_array_const msgs, uint64_t capacity, - uint64_t *count) + bt_self_message_iterator *message_iterator __attribute__((unused)), + bt_message_array_const msgs __attribute__((unused)), + uint64_t capacity __attribute__((unused)), + uint64_t *count __attribute__((unused))) { BT_ASSERT(false); return BT_MESSAGE_ITERATOR_CLASS_NEXT_METHOD_STATUS_OK; } -int main(int argc, char **argv) +int main(void) { bt_graph *graph; bt_message_iterator_class *msg_iter_cls; diff --git a/tests/lib/test-simple-sink.c b/tests/lib/test-simple-sink.c index 952b6bf5..4bf97d4f 100644 --- a/tests/lib/test-simple-sink.c +++ b/tests/lib/test-simple-sink.c @@ -49,8 +49,9 @@ void simple_fini_func(void *data) static bt_component_class_initialize_method_status src_init( bt_self_component_source *self_comp, - bt_self_component_source_configuration *config, - const bt_value *params, void *init_method_data) + bt_self_component_source_configuration *config __attribute__((unused)), + const bt_value *params __attribute__((unused)), + void *init_method_data __attribute__((unused))) { bt_self_component_add_port_status status; @@ -62,9 +63,10 @@ bt_component_class_initialize_method_status src_init( static bt_message_iterator_class_next_method_status src_iter_next( - bt_self_message_iterator *message_iterator, - bt_message_array_const msgs, uint64_t capacity, - uint64_t *count) + bt_self_message_iterator *message_iterator __attribute__((unused)), + bt_message_array_const msgs __attribute__((unused)), + uint64_t capacity __attribute__((unused)), + uint64_t *count __attribute__((unused))) { return BT_MESSAGE_ITERATOR_CLASS_NEXT_METHOD_STATUS_END; } diff --git a/tests/lib/test-trace-ir-ref.c b/tests/lib/test-trace-ir-ref.c index 70caf29c..5d0bdfd9 100644 --- a/tests/lib/test-trace-ir-ref.c +++ b/tests/lib/test-trace-ir-ref.c @@ -398,8 +398,9 @@ static void test_example_scenario(bt_self_component_source *self_comp) static bt_component_class_initialize_method_status src_init( bt_self_component_source *self_comp, - bt_self_component_source_configuration *config, - const bt_value *params, void *init_method_data) + bt_self_component_source_configuration *config __attribute__((unused)), + const bt_value *params __attribute__((unused)), + void *init_method_data __attribute__((unused))) { test_example_scenario(self_comp); return BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK; @@ -407,9 +408,10 @@ bt_component_class_initialize_method_status src_init( static bt_message_iterator_class_next_method_status src_iter_next( - bt_self_message_iterator *self_iterator, - bt_message_array_const msgs, uint64_t capacity, - uint64_t *count) + bt_self_message_iterator *self_iterator __attribute__((unused)), + bt_message_array_const msgs __attribute__((unused)), + uint64_t capacity __attribute__((unused)), + uint64_t *count __attribute__((unused))) { return BT_MESSAGE_ITERATOR_CLASS_NEXT_METHOD_STATUS_ERROR; } @@ -571,7 +573,7 @@ static void test_put_order(void) * External tools (e.g. valgrind) should be used to confirm that this * known-good test does not leak memory. */ -int main(int argc, char **argv) +int main(void) { /* Initialize tap harness before any tests */ plan_tests(NR_TESTS); diff --git a/tests/param-validation/test-param-validation.c b/tests/param-validation/test-param-validation.c index fa140104..5607d320 100644 --- a/tests/param-validation/test-param-validation.c +++ b/tests/param-validation/test-param-validation.c @@ -282,7 +282,7 @@ void test_string_invalid_choice(void) static enum bt_param_validation_status custom_validation_func_valid( const bt_value *value, - struct bt_param_validation_context *context) + struct bt_param_validation_context *context __attribute__((unused))) { ok(bt_value_get_type(value) == BT_VALUE_TYPE_UNSIGNED_INTEGER, "type of value passed to custom function is as expected"); @@ -306,7 +306,7 @@ void test_custom_validation_func_valid(void) static enum bt_param_validation_status custom_validation_func_invalid( - const bt_value *value, + const bt_value *value __attribute__((unused)), struct bt_param_validation_context *context) { return bt_param_validation_error(context, "wrooooong"); diff --git a/tests/utils/common.c b/tests/utils/common.c index ee7780f4..8c5e8507 100644 --- a/tests/utils/common.c +++ b/tests/utils/common.c @@ -16,8 +16,10 @@ #define RMDIR_NFDOPEN 8 static -int nftw_recursive_rmdir(const char *file, const struct stat *sb, int flag, - struct FTW *s) +int nftw_recursive_rmdir(const char *file, + const struct stat *sb __attribute__((unused)), + int flag, + struct FTW *s __attribute__((unused))) { switch (flag) { case FTW_F: diff --git a/tests/utils/tap/tap.c b/tests/utils/tap/tap.c index 9f41408b..5fa9482b 100644 --- a/tests/utils/tap/tap.c +++ b/tests/utils/tap/tap.c @@ -44,12 +44,12 @@ static void _cleanup(void); #ifdef __MINGW32__ static inline -void flockfile (FILE * filehandle) { +void flockfile (FILE * filehandle __attribute__((unused))) { return; } static inline -void funlockfile(FILE * filehandle) { +void funlockfile(FILE * filehandle __attribute__((unused))) { return; } #endif -- 2.34.1