From 4f72989680381dc7c34b7bfc5d3108b922256c06 Mon Sep 17 00:00:00 2001 From: gambas Date: Fri, 8 Feb 2019 23:07:47 +0100 Subject: [PATCH] Unused function warnings now point at the beginning of the function. [COMPILER] * BUG: Unused function warnings now point at the beginning of the function. --- main/gbc/gbc_class.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/gbc/gbc_class.c b/main/gbc/gbc_class.c index 956c81664..d7b832a16 100644 --- a/main/gbc/gbc_class.c +++ b/main/gbc/gbc_class.c @@ -239,7 +239,7 @@ void CLASS_check_unused_global(CLASS *class) if (TYPE_get_kind(type) == TK_VARIABLE) COMPILE_print(MSG_WARNING, sym->global.line, "unused global variable: &1", SYMBOL_get_name(&sym->symbol)); else if (TYPE_get_kind(type) == TK_FUNCTION) - COMPILE_print(MSG_WARNING, sym->global.line, "unused function: &1", SYMBOL_get_name(&sym->symbol)); + COMPILE_print(MSG_WARNING, class->function[sym->global.value].line - 1, "unused function: &1", SYMBOL_get_name(&sym->symbol)); else if (TYPE_get_kind(type) == TK_EXTERN) COMPILE_print(MSG_WARNING, sym->global.line, "unused extern function: &1", SYMBOL_get_name(&sym->symbol)); }