From 878c1180c71e4fd034e2a2a4cddff8a8b573dc95 Mon Sep 17 00:00:00 2001 From: bdrouvot Date: Mon, 16 Sep 2024 07:23:46 +0000 Subject: [PATCH] Avoid compiler warnings about unused variable As max_trace_spans is used only for ASSERT, declare it with PG_USED_FOR_ASSERTS_ONLY. --- src/pg_tracing.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pg_tracing.c b/src/pg_tracing.c index c500994..54029f2 100644 --- a/src/pg_tracing.c +++ b/src/pg_tracing.c @@ -1361,7 +1361,7 @@ handle_pg_error(const Traceparent * traceparent, { int sql_error_code; Span *span; - int max_trace_spans = current_trace_spans->max; + int max_trace_spans PG_USED_FOR_ASSERTS_ONLY = current_trace_spans->max; sql_error_code = geterrcode();