summaryrefslogtreecommitdiffstats
path: root/txr.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-03-22 06:49:03 -0700
committerKaz Kylheku <kaz@kylheku.com>2017-03-22 06:49:03 -0700
commitf8d6e538338b9d2635b8f933325f920c0ea21e06 (patch)
tree7e991b9d96a0171666aab06f1b65e8a5ecc77023 /txr.c
parent7e2f1500f34098be4a0cc0b2130cffb3a729793b (diff)
downloadtxr-f8d6e538338b9d2635b8f933325f920c0ea21e06.tar.gz
txr-f8d6e538338b9d2635b8f933325f920c0ea21e06.tar.bz2
txr-f8d6e538338b9d2635b8f933325f920c0ea21e06.zip
Bugfix: missing warnings when main file is .txr.
If the main file of an application is a .txr file, unbound function and variable warnings are not being generated. * match.c (v_load): For consistency with the load function in eval.c, release deferred warnings in the normal return case, if we are not a recursive load. However, this doesn't fix anything because a load or include is always recursive being invoked from a .txr file that is being loaded. The problem is in fact that the recursive flag is nil when it shouldn't be, and then the uw_unwind block obliterates the warnings. * txr.c (txr_main): We must bind *load-recursive* to t around not just the loading of Lisp, but also of TXR. Otherwise the individual loads will release warnings, raising false positives for forward references.
Diffstat (limited to 'txr.c')
-rw-r--r--txr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/txr.c b/txr.c
index b15d275a..afe07971 100644
--- a/txr.c
+++ b/txr.c
@@ -969,6 +969,8 @@ int txr_main(int argc, char **argv)
reg_var(args_s, or2(orig_args, arg_list));
reg_varl(intern(lit("self-path"), user_package), spec_file_str);
+ env_vbind(dyn_env, load_recursive_s, t);
+
if (!txr_lisp_p)
{
int gc = gc_state(0);
@@ -1012,8 +1014,6 @@ int txr_main(int argc, char **argv)
reg_varl(car(binding), cdr(binding));
}
- env_vbind(dyn_env, load_recursive_s, t);
-
{
val result = read_eval_stream(parse_stream, std_error, t);