From d854836afffed120c0a92419c85182389069d424 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Thu, 3 Apr 2025 15:37:53 +0100 Subject: [PATCH] girparser: Fix a strict-aliasing warning with g_clear_pointer() Casting the type for a `g_clear_pointer()` call breaks strict aliasing rules. Signed-off-by: Philip Withnall --- girepository/girparser.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/girepository/girparser.c b/girepository/girparser.c index 953bec589..ab8d46bcc 100644 --- a/girepository/girparser.c +++ b/girepository/girparser.c @@ -2401,7 +2401,11 @@ end_type_recurse (ParseContext *ctx) else g_assert_not_reached (); } - g_clear_pointer ((GIIrNode **) ¶m, gi_ir_node_free); + + if (param != NULL) + gi_ir_node_free ((GIIrNode *) param); + param = NULL; + g_list_free_full (ctx->type_parameters, (GDestroyNotify) gi_ir_node_free); ctx->type_parameters = (GList *)ctx->type_stack->data; ctx->type_stack = g_list_delete_link (ctx->type_stack, ctx->type_stack);