From: Robert Pengelly Date: Thu, 17 Sep 2026 04:05:11 +0000 (+0100) Subject: Fix unused warning for address-taken functions X-Git-Url: https://git.candlhat.org/?a=commitdiff_plain;h=c95125ecf18945851ad6aaa4daafcb64a3e56b0f;p=scc.git Fix unused warning for address-taken functions --- diff --git a/amd64.c b/amd64.c index b359810..07b99d4 100644 --- a/amd64.c +++ b/amd64.c @@ -20469,9 +20469,12 @@ static void emit_load_assignment_rhs_to_reg (const char *reg) { if (find_global_symbol (name) >= 0) { - emit_load_address_to_reg_now (reg, name); + int global_index = find_global_symbol (name); + global_symbols[global_index].used = 1; + emit_load_address_to_reg_now (reg, name); free (name); + return; } diff --git a/i386.c b/i386.c index 39b62fc..cdcb61f 100644 --- a/i386.c +++ b/i386.c @@ -19127,9 +19127,12 @@ static void emit_load_assignment_rhs_to_reg (const char *reg) { if (find_global_symbol (name) >= 0) { - emit_load_address_to_reg_now (reg, name); + int global_index = find_global_symbol (name); + global_symbols[global_index].used = 1; + emit_load_address_to_reg_now (reg, name); free (name); + return; }