From f4e2bc6a8ab9f8c1557904d36151c691f726477c Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Fri, 5 May 2023 22:59:47 -0400 Subject: [PATCH] debug-info: fix -Wenum-int-mismatch problem in copy_field_class_content_internal GCC 13 points out that the return value differs between the declaration and definition of copy_field_class_content_internal, fix that. CC trace-ir-metadata-field-class-copy.lo cc1: warning: command-line option '-Wsuggest-override' is valid for C++/ObjC++ but not for C /home/smarchi/src/babeltrace/src/plugins/lttng-utils/debug-info/trace-ir-metadata-field-class-copy.c:885:41: error: conflicting types for 'copy_field_class_content_internal' due to enum/integer mismatch; have 'enum debug_info_trace_ir_mapping_status(struct trace_ir_metadata_maps *, const bt_field_class *, bt_field_class *)' [-Werror=enum-int-mismatch] 885 | enum debug_info_trace_ir_mapping_status copy_field_class_content_internal( | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /home/smarchi/src/babeltrace/src/plugins/lttng-utils/debug-info/trace-ir-metadata-field-class-copy.c:22: /home/smarchi/src/babeltrace/src/plugins/lttng-utils/debug-info/trace-ir-metadata-field-class-copy.h:17:5: note: previous declaration of 'copy_field_class_content_internal' with type 'int(struct trace_ir_metadata_maps *, const bt_field_class *, bt_field_class *)' 17 | int copy_field_class_content_internal(struct trace_ir_metadata_maps *trace_ir_metadata_maps, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Change-Id: I9c0dd3ffc3ba1a2e9fbbca948a391357ae28a483 Signed-off-by: Simon Marchi Reviewed-on: https://review.lttng.org/c/babeltrace/+/9986 Tested-by: jenkins Reviewed-by: Philippe Proulx --- .../debug-info/trace-ir-metadata-field-class-copy.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/lttng-utils/debug-info/trace-ir-metadata-field-class-copy.h b/src/plugins/lttng-utils/debug-info/trace-ir-metadata-field-class-copy.h index 0cbcaa18..65c6ecd7 100644 --- a/src/plugins/lttng-utils/debug-info/trace-ir-metadata-field-class-copy.h +++ b/src/plugins/lttng-utils/debug-info/trace-ir-metadata-field-class-copy.h @@ -14,7 +14,8 @@ #include "common/macros.h" #include "trace-ir-mapping.h" -int copy_field_class_content_internal(struct trace_ir_metadata_maps *trace_ir_metadata_maps, +enum debug_info_trace_ir_mapping_status copy_field_class_content_internal( + struct trace_ir_metadata_maps *trace_ir_metadata_maps, const bt_field_class *in_field_class, bt_field_class *out_field_class); -- 2.34.1