From 96c4d9eecbeb2b719184c64f440cd682ef1730ba Mon Sep 17 00:00:00 2001 From: Alexander Rosenberg Date: Sun, 21 Sep 2025 03:33:14 -0700 Subject: [PATCH] Fix warnings when building in release mode --- src/lisp.c | 14 +++++++------- src/lisp.h | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/lisp.c b/src/lisp.c index c2406b9..41a2b64 100644 --- a/src/lisp.c +++ b/src/lisp.c @@ -238,8 +238,8 @@ void set_function_args(LispFunction *func, LispVal *args) { func->kwargs = make_lisp_hashtable(Qnil, Qnil); func->allow_other_keys = false; - LispVal *rargs_end; - LispVal *oargs_end; + LispVal *rargs_end = Qnil; + LispVal *oargs_end = Qnil; FOREACH(arg, args) { if (arg == Qopt) { @@ -801,7 +801,7 @@ void cancel_cleanup(void *handle) { DEFUN(backtrace, "backtrace", (void) ) { LispVal *head = Qnil; - LispVal *end; + LispVal *end = Qnil; for (StackFrame *frame = the_stack; frame; frame = frame->next) { if (frame->hidden) { continue; @@ -1274,7 +1274,7 @@ static inline LispVal *eval_function_args(LispVal *args, LispVal *lexenv) { WITH_PUSH_FRAME(Qnil, Qnil, true, { void *cl_handle = register_cleanup( (lisp_cleanup_func_t) &unref_double_ptr, &final_args); - LispVal *end; + LispVal *end = Qnil; FOREACH(elt, args) { if (NILP(final_args)) { final_args = Fpair(Feval_in_env(elt, lexenv), Qnil); @@ -1302,7 +1302,7 @@ static LispVal **process_builtin_args(LispVal *fname, LispFunction *func, LispVal **vec = lisp_malloc(sizeof(LispVal *) * raw_count); memset(vec, 0, sizeof(LispVal *) * raw_count); LispVal *rest = Qnil; - LispVal *rest_end; + LispVal *rest_end = Qnil; size_t have_count = 0; LispVal *opt_desc; LispVal *arg = Qnil; // last arg processed @@ -1976,7 +1976,7 @@ static LispVal *filter_body_tree(LispVal *body, void *user_data), void *user_data) { LispVal *start = Qnil; - LispVal *end; + LispVal *end = Qnil; FOREACH(form, body) { LispVal *filtered = filter_body_form(form, func, user_data); if (NILP(start)) { @@ -2006,7 +2006,7 @@ DEFUN(macroexpand_all, "macroexpand-all", DEFUN(apply, "apply", (LispVal * function, LispVal *rest)) { LispVal *args = Qnil; - LispVal *end; + LispVal *end = Qnil; while (!NILP(rest) && !NILP(((LispPair *) rest)->tail)) { if (NILP(args)) { args = Fpair(((LispPair *) rest)->head, Qnil); diff --git a/src/lisp.h b/src/lisp.h index a5633db..7c503a3 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -358,7 +358,7 @@ DECLARE_FUNCTION(settail, (LispVal * pair, LispVal *tail)); size_t list_length(LispVal *obj); static inline LispVal *const_list(bool do_ref, int len, ...) { LispVal *list = Qnil; - LispVal *end; + LispVal *end = Qnil; va_list args; va_start(args, len); while (len--) {