mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-16 06:18:47 +02:00
Warn if a variable is UNSET without having been used (if -du is in effect)
This commit is contained in:
@@ -581,6 +581,9 @@ int DeleteVar(char const *str)
|
||||
|
||||
v = FindVar(str, 0);
|
||||
if (!v) return E_NOSUCH_VAR;
|
||||
if ((DebugFlag & DB_UNUSED_VARS) && !v->used_since_set) {
|
||||
Eprint(tr("`%s' UNSET without being used (previous SET: %s:%d)"), str, v->filename, v->lineno);
|
||||
}
|
||||
DestroyValue(v->v);
|
||||
hash_table_delete(&VHashTbl, v);
|
||||
return OK;
|
||||
|
||||
@@ -741,6 +741,8 @@ endif
|
||||
|
||||
set x 44
|
||||
set x 45
|
||||
set y 1000
|
||||
unset y
|
||||
EOF
|
||||
|
||||
# Make sure all the include files are ok
|
||||
|
||||
@@ -24994,6 +24994,7 @@ TRANSLATE "Warning: Variable name `%.*s...' truncated to `%.*s'" ""
|
||||
TRANSLATE "You have OMITted everything! The space-time continuum is at risk." ""
|
||||
TRANSLATE "\\x00 is not a valid escape sequence" ""
|
||||
TRANSLATE "`%%%c' substitution sequence should not be used without an AT clause" ""
|
||||
TRANSLATE "`%s' UNSET without being used (previous SET: %s:%d)" ""
|
||||
TRANSLATE "`%s' re-SET without being used (previous SET: %s:%d)" ""
|
||||
TRANSLATE "did you mean" ""
|
||||
TRANSLATE "here" ""
|
||||
@@ -38717,6 +38718,7 @@ utctolocal(2050-11-06@04:00) => 2050-11-06@00:00
|
||||
utctolocal(2050-11-06@07:00) => 2050-11-06@02:00
|
||||
No reminders.
|
||||
-stdin-(9): `x' re-SET without being used (previous SET: -stdin-:8)
|
||||
-stdin-(11): `y' UNSET without being used (previous SET: -stdin-:10)
|
||||
The following variables were set, but not subsequently used:
|
||||
b - defined at -stdin-:2
|
||||
x - defined at -stdin-:9
|
||||
|
||||
Reference in New Issue
Block a user