From 80d58220fea6a8c0c86dad45db75eaa0652d653d Mon Sep 17 00:00:00 2001 From: Dianne Skoll Date: Wed, 28 Aug 2024 14:59:13 -0400 Subject: [PATCH] In warnings, give file/lineno where function is defined. --- src/dorem.c | 2 +- tests/test.cmp | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/dorem.c b/src/dorem.c index 304e9329..a3b4840e 100644 --- a/src/dorem.c +++ b/src/dorem.c @@ -74,7 +74,7 @@ check_trigger_function(char const *fname, char const *type) if (ensure_expr_references_first_local_arg(f->node)) { return; } - Wprint("%s function `%s' does not use its argument", type, fname); + Wprint("%s function `%s' defined at %s:%d does not use its argument", type, fname, f->filename, f->lineno); } static int diff --git a/tests/test.cmp b/tests/test.cmp index 7d63cb8a..d5831afe 100644 --- a/tests/test.cmp +++ b/tests/test.cmp @@ -788,7 +788,7 @@ OMIT 1 March OMIT 2 March 1991 REM 1 March OMIT Sun OMITFUNC _ofunc AFTER MSG Should trigger 1 March ../tests/test.rem(226): Warning: OMIT is ignored if you use OMITFUNC -../tests/test.rem(226): OMITFUNC function `_ofunc' does not use its argument +../tests/test.rem(226): OMITFUNC function `_ofunc' defined at ../tests/test.rem:223 does not use its argument Entering UserFN _ofunc(1991-02-15) Leaving UserFN _ofunc(1991-02-15) => 0 Entering UserFN _ofunc(1991-03-01) @@ -3966,7 +3966,7 @@ psmoon(0) => ../tests/test.rem(809): psmoon() is deprecated; use SPECIAL MOON in FSET _f(x) 0 SET tmp evaltrig("Wed SKIP OMITFUNC _f",date(1992,1,8)) date(1992, 1, 8) => 1992-01-08 -evaltrig("Wed SKIP OMITFUNC _f", 1992-01-08) => ../tests/test.rem(813): OMITFUNC function `_f' does not use its argument +evaltrig("Wed SKIP OMITFUNC _f", 1992-01-08) => ../tests/test.rem(813): OMITFUNC function `_f' defined at ../tests/test.rem:812 does not use its argument Entering UserFN _f(1992-01-08) Leaving UserFN _f(1992-01-08) => 0 ../tests/test.rem(813): Trig = Wednesday, 8 January, 1992 @@ -5354,19 +5354,19 @@ max(3, 3, 4, 5, 6) => 6 FSET gg(x) 0 REM WARN gg MSG Wookie -../tests/test.rem(1031): WARN function `gg' does not use its argument +../tests/test.rem(1031): WARN function `gg' defined at ../tests/test.rem:1030 does not use its argument ../tests/test.rem(1031): Trig = Saturday, 16 February, 1991 Entering UserFN gg(1) Leaving UserFN gg(1) => 0 Wookie REM AT 11:00 SCHED gg MSG blork -../tests/test.rem(1032): SCHED function `gg' does not use its argument +../tests/test.rem(1032): SCHED function `gg' defined at ../tests/test.rem:1030 does not use its argument ../tests/test.rem(1032): Trig = Saturday, 16 February, 1991 AT 11:00 blork REM OMITFUNC gg MSG hehe -../tests/test.rem(1033): OMITFUNC function `gg' does not use its argument +../tests/test.rem(1033): OMITFUNC function `gg' defined at ../tests/test.rem:1030 does not use its argument ../tests/test.rem(1033): Trig = Saturday, 16 February, 1991 hehe