From f7a6599c4eb2031422567adddf802696db50514e Mon Sep 17 00:00:00 2001 From: "xiang.zhou" Date: Fri, 27 Dec 2024 14:49:37 +0800 Subject: [PATCH] fix:build error when using a higher version of the compiler --- src/otel/otel_manager.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/otel/otel_manager.c b/src/otel/otel_manager.c index 12d0236ed..0df7b5828 100644 --- a/src/otel/otel_manager.c +++ b/src/otel/otel_manager.c @@ -880,7 +880,8 @@ void neu_otel_scope_set_status_code(neu_otel_scope_ctx ctx, scope->span->status = calloc(1, sizeof(Opentelemetry__Proto__Trace__V1__Status)); opentelemetry__proto__trace__v1__status__init(scope->span->status); - scope->span->status->code = code; + scope->span->status->code = + (Opentelemetry__Proto__Trace__V1__Status__StatusCode) code; scope->span->status->message = strdup(desc); } @@ -893,7 +894,8 @@ void neu_otel_scope_set_status_code2(neu_otel_scope_ctx ctx, opentelemetry__proto__trace__v1__status__init(scope->span->status); char *error_buf = calloc(1, 16); sprintf(error_buf, "%d", errorno); - scope->span->status->code = code; + scope->span->status->code = + (Opentelemetry__Proto__Trace__V1__Status__StatusCode) code; scope->span->status->message = error_buf; }