diff --git a/libkc3/buf_parse_s.c.in b/libkc3/buf_parse_s.c.in
index c3af3c7..5c5a767 100644
--- a/libkc3/buf_parse_s.c.in
+++ b/libkc3/buf_parse_s.c.in
@@ -27,8 +27,8 @@ sw buf_parse_s_bits$ (s_buf *buf, s_bits$ *dest)
sw r1;
sw result = 0;
s_buf_save save;
- s_bits$ tmp;
- s_bits$ tmp1;
+ s_bits$ tmp = 0;
+ s_bits$ tmp1 = 0;
assert(buf);
assert(dest);
buf_save_init(buf, &save);
diff --git a/libkc3/buf_parse_s16.c b/libkc3/buf_parse_s16.c
index e761b83..710b38b 100644
--- a/libkc3/buf_parse_s16.c
+++ b/libkc3/buf_parse_s16.c
@@ -27,8 +27,8 @@ sw buf_parse_s16 (s_buf *buf, s16 *dest)
sw r1;
sw result = 0;
s_buf_save save;
- s16 tmp;
- s16 tmp1;
+ s16 tmp = 0;
+ s16 tmp1 = 0;
assert(buf);
assert(dest);
buf_save_init(buf, &save);
diff --git a/libkc3/buf_parse_s32.c b/libkc3/buf_parse_s32.c
index f836295..266976a 100644
--- a/libkc3/buf_parse_s32.c
+++ b/libkc3/buf_parse_s32.c
@@ -27,8 +27,8 @@ sw buf_parse_s32 (s_buf *buf, s32 *dest)
sw r1;
sw result = 0;
s_buf_save save;
- s32 tmp;
- s32 tmp1;
+ s32 tmp = 0;
+ s32 tmp1 = 0;
assert(buf);
assert(dest);
buf_save_init(buf, &save);
diff --git a/libkc3/buf_parse_s64.c b/libkc3/buf_parse_s64.c
index a0d5e76..c9813d8 100644
--- a/libkc3/buf_parse_s64.c
+++ b/libkc3/buf_parse_s64.c
@@ -27,8 +27,8 @@ sw buf_parse_s64 (s_buf *buf, s64 *dest)
sw r1;
sw result = 0;
s_buf_save save;
- s64 tmp;
- s64 tmp1;
+ s64 tmp = 0;
+ s64 tmp1 = 0;
assert(buf);
assert(dest);
buf_save_init(buf, &save);
diff --git a/libkc3/buf_parse_s8.c b/libkc3/buf_parse_s8.c
index af12f83..0873e8f 100644
--- a/libkc3/buf_parse_s8.c
+++ b/libkc3/buf_parse_s8.c
@@ -27,8 +27,8 @@ sw buf_parse_s8 (s_buf *buf, s8 *dest)
sw r1;
sw result = 0;
s_buf_save save;
- s8 tmp;
- s8 tmp1;
+ s8 tmp = 0;
+ s8 tmp1 = 0;
assert(buf);
assert(dest);
buf_save_init(buf, &save);
diff --git a/libkc3/buf_parse_sw.c b/libkc3/buf_parse_sw.c
index f564f22..5852ce8 100644
--- a/libkc3/buf_parse_sw.c
+++ b/libkc3/buf_parse_sw.c
@@ -27,8 +27,8 @@ sw buf_parse_sw (s_buf *buf, sw *dest)
sw r1;
sw result = 0;
s_buf_save save;
- sw tmp;
- sw tmp1;
+ sw tmp = 0;
+ sw tmp1 = 0;
assert(buf);
assert(dest);
buf_save_init(buf, &save);
diff --git a/libkc3/buf_parse_u.c.in b/libkc3/buf_parse_u.c.in
index 14f35ae..1d95e72 100644
--- a/libkc3/buf_parse_u.c.in
+++ b/libkc3/buf_parse_u.c.in
@@ -27,8 +27,8 @@ sw buf_parse_u_bits$ (s_buf *buf, u_bits$ *dest)
sw r1;
sw result = 0;
s_buf_save save;
- u_bits$ tmp;
- u_bits$ tmp1;
+ u_bits$ tmp = 0;
+ u_bits$ tmp1 = 0;
assert(buf);
assert(dest);
buf_save_init(buf, &save);
diff --git a/libkc3/buf_parse_u16.c b/libkc3/buf_parse_u16.c
index c7581f7..83f2aa3 100644
--- a/libkc3/buf_parse_u16.c
+++ b/libkc3/buf_parse_u16.c
@@ -27,8 +27,8 @@ sw buf_parse_u16 (s_buf *buf, u16 *dest)
sw r1;
sw result = 0;
s_buf_save save;
- u16 tmp;
- u16 tmp1;
+ u16 tmp = 0;
+ u16 tmp1 = 0;
assert(buf);
assert(dest);
buf_save_init(buf, &save);
diff --git a/libkc3/buf_parse_u32.c b/libkc3/buf_parse_u32.c
index 0db98e6..9f34216 100644
--- a/libkc3/buf_parse_u32.c
+++ b/libkc3/buf_parse_u32.c
@@ -27,8 +27,8 @@ sw buf_parse_u32 (s_buf *buf, u32 *dest)
sw r1;
sw result = 0;
s_buf_save save;
- u32 tmp;
- u32 tmp1;
+ u32 tmp = 0;
+ u32 tmp1 = 0;
assert(buf);
assert(dest);
buf_save_init(buf, &save);
diff --git a/libkc3/buf_parse_u64.c b/libkc3/buf_parse_u64.c
index a20ea69..bd53f7e 100644
--- a/libkc3/buf_parse_u64.c
+++ b/libkc3/buf_parse_u64.c
@@ -27,8 +27,8 @@ sw buf_parse_u64 (s_buf *buf, u64 *dest)
sw r1;
sw result = 0;
s_buf_save save;
- u64 tmp;
- u64 tmp1;
+ u64 tmp = 0;
+ u64 tmp1 = 0;
assert(buf);
assert(dest);
buf_save_init(buf, &save);
diff --git a/libkc3/buf_parse_u8.c b/libkc3/buf_parse_u8.c
index f2a8430..279290b 100644
--- a/libkc3/buf_parse_u8.c
+++ b/libkc3/buf_parse_u8.c
@@ -27,8 +27,8 @@ sw buf_parse_u8 (s_buf *buf, u8 *dest)
sw r1;
sw result = 0;
s_buf_save save;
- u8 tmp;
- u8 tmp1;
+ u8 tmp = 0;
+ u8 tmp1 = 0;
assert(buf);
assert(dest);
buf_save_init(buf, &save);
diff --git a/libkc3/buf_parse_uw.c b/libkc3/buf_parse_uw.c
index 7d5accb..0621cd7 100644
--- a/libkc3/buf_parse_uw.c
+++ b/libkc3/buf_parse_uw.c
@@ -27,8 +27,8 @@ sw buf_parse_uw (s_buf *buf, uw *dest)
sw r1;
sw result = 0;
s_buf_save save;
- uw tmp;
- uw tmp1;
+ uw tmp = 0;
+ uw tmp1 = 0;
assert(buf);
assert(dest);
buf_save_init(buf, &save);
diff --git a/libkc3/buf_rw.c b/libkc3/buf_rw.c
index f593bfe..e8cf2d9 100644
--- a/libkc3/buf_rw.c
+++ b/libkc3/buf_rw.c
@@ -32,7 +32,7 @@ void buf_rw_fd_close (s_buf_rw *buf_rw)
s_buf_rw * buf_rw_fd_open (s_buf_rw *buf_rw, s32 fd)
{
- s_buf_rw tmp;
+ s_buf_rw tmp = {0};
assert(buf_rw);
tmp = *buf_rw;
if (! buf_fd_open_r(&tmp.r, fd))
diff --git a/libkc3/call.c b/libkc3/call.c
index ff199a3..7be110a 100644
--- a/libkc3/call.c
+++ b/libkc3/call.c
@@ -159,7 +159,7 @@ s_call * call_init_op_unary (s_call *call)
s_str * call_inspect (const s_call *call, s_str *dest)
{
sw size;
- s_buf tmp;
+ s_buf tmp = {0};
size = buf_inspect_call_size(call);
if (size < 0) {
assert(! "error");
diff --git a/libkc3/cfn.c b/libkc3/cfn.c
index 59930af..468f95d 100644
--- a/libkc3/cfn.c
+++ b/libkc3/cfn.c
@@ -36,8 +36,8 @@ s_tag * cfn_apply (s_cfn *cfn, s_list *args, s_tag *dest)
sw i = 0;
sw num_args;
void *result = NULL;
- s_tag tmp;
- s_tag tmp2;
+ s_tag tmp = {0};
+ s_tag tmp2 = {0};
assert(cfn);
assert(cfn->arity == cfn->cif.nargs);
num_args = list_length(args);
diff --git a/libkc3/compare.c b/libkc3/compare.c
index 1c89c4c..01dfa6f 100644
--- a/libkc3/compare.c
+++ b/libkc3/compare.c
@@ -555,8 +555,8 @@ s8 compare_sym (const s_sym *a, const s_sym *b)
s8 compare_tag (const s_tag *a, const s_tag *b) {
s8 r;
- s_integer tmp;
- s_integer tmp2;
+ s_integer tmp = {0};
+ s_integer tmp2 = {0};
if (a == b)
return 0;
if (!a ||
diff --git a/libkc3/complex.c b/libkc3/complex.c
index 44b7797..ce1ec7e 100644
--- a/libkc3/complex.c
+++ b/libkc3/complex.c
@@ -326,7 +326,7 @@ s_tag * complex_norm (const s_complex *c, s_tag *dest)
{
s_complex d;
s_tag sum;
- s_tag tmp;
+ s_tag tmp = {0};
assert(c);
tag_mul(&c->x, &c->x, &d.x);
tag_mul(&c->y, &c->y, &d.y);
diff --git a/libkc3/cow.c b/libkc3/cow.c
index 9b8a67f..7327388 100644
--- a/libkc3/cow.c
+++ b/libkc3/cow.c
@@ -37,7 +37,7 @@ void cow_delete (s_cow *cow)
s_cow * cow_freeze (s_cow *cow)
{
- s_list *tmp;
+ s_list *tmp = NULL;
assert(cow);
assert(cow->list);
tmp = list_new_tag_copy(&cow->list->tag, cow->list);
@@ -49,7 +49,7 @@ s_cow * cow_freeze (s_cow *cow)
s_cow * cow_freeze_copy (s_cow *cow, const s_tag *src)
{
- s_list *tmp;
+ s_list *tmp = NULL;
assert(cow);
assert(cow->list);
tmp = list_new_tag_copy(src, list_next(cow->list));
@@ -97,7 +97,7 @@ s_cow * cow_init_cast (s_cow *cow, const s_sym * const *type,
const s_tag *tag)
{
void *data;
- s_cow tmp;
+ s_cow tmp = {0};
assert(tag);
assert(type);
assert(tag);
@@ -260,7 +260,7 @@ s_tag * cow_read_write (s_cow *cow)
s_cow * cow_thaw (s_cow *cow)
{
- s_tag tmp;
+ s_tag tmp = {0};
assert(cow);
assert(cow->list);
assert(list_next(cow->list));
@@ -278,7 +278,7 @@ s_cow * cow_thaw (s_cow *cow)
s_cow * cow_thaw_copy (s_cow *cow, const s_tag *src)
{
- s_tag tmp;
+ s_tag tmp = {0};
assert(cow);
assert(cow->list);
assert(src);
diff --git a/libkc3/env.c b/libkc3/env.c
index 354b4f7..b642f26 100644
--- a/libkc3/env.c
+++ b/libkc3/env.c
@@ -525,7 +525,7 @@ bool env_eval_block (s_env *env, const s_block *block, s_tag *dest)
{
uw i = 0;
bool r;
- s_tag tmp;
+ s_tag tmp = {0};
assert(env);
assert(block);
assert(dest);
@@ -736,7 +736,7 @@ bool env_eval_call_fn_args (s_env *env, const s_fn *fn,
bool env_eval_call_resolve (s_env *env, s_call *call)
{
bool b;
- s_call tmp;
+ s_call tmp = {0};
const s_tag *value;
assert(env);
assert(call);
@@ -792,7 +792,7 @@ bool env_eval_call_resolve (s_env *env, s_call *call)
bool env_eval_cfn (s_env *env, const s_cfn *cfn, s_tag *dest)
{
- s_cfn tmp;
+ s_cfn tmp = {0};
assert(cfn);
assert(dest);
(void) env;
@@ -854,7 +854,7 @@ bool env_eval_equal_cow (s_env *env, const s_cow *a,
const s_cow *b, s_cow **dest)
{
s8 r;
- s_cow *tmp;
+ s_cow *tmp = {0};
assert(env);
assert(a);
assert(b);
@@ -928,7 +928,7 @@ bool env_eval_equal_map (s_env *env, bool macro, const s_map *a,
const s_map *c;
uw i;
uw j;
- s_tag tmp;
+ s_tag tmp = {0};
assert(env);
assert(a);
assert(b);
@@ -1158,7 +1158,7 @@ bool env_eval_equal_tuple (s_env *env, bool macro, const s_tuple *a,
const s_tuple *b, s_tuple *dest)
{
uw i;
- s_tuple tmp;
+ s_tuple tmp = {0};
assert(env);
assert(a);
assert(b);
@@ -1197,7 +1197,7 @@ bool env_eval_fn (s_env *env, const s_fn *fn, s_tag *dest)
bool env_eval_ident (s_env *env, const s_ident *ident, s_tag *dest)
{
const s_tag *tag;
- s_tag tmp;
+ s_tag tmp = {0};
s_ident tmp_ident;
assert(env);
assert(ident);
@@ -1219,8 +1219,8 @@ bool env_eval_ident (s_env *env, const s_ident *ident, s_tag *dest)
bool env_eval_ident_is_bound (s_env *env, const s_ident *ident)
{
- s_ident tmp_ident;
- s_tag tmp;
+ s_ident tmp_ident = {0};
+ s_tag tmp = {0};
assert(env);
assert(ident);
if (env_frames_get(env, ident->sym))
@@ -1261,7 +1261,7 @@ bool env_eval_list (s_env *env, const s_list *list, s_tag *dest)
bool env_eval_map (s_env *env, const s_map *map, s_tag *dest)
{
- s_map tmp;
+ s_map tmp = {0};
uw i = 0;
assert(env);
assert(map);
@@ -1336,7 +1336,7 @@ bool env_eval_quote_array (s_env *env, const s_array *array,
bool env_eval_quote_block (s_env *env, const s_block *block, s_tag *dest)
{
uw i = 0;
- s_block tmp;
+ s_block tmp = {0};
assert(env);
assert(block);
assert(dest);
@@ -1433,7 +1433,7 @@ bool env_eval_quote_cow (s_env *env, const s_cow *cow,
bool env_eval_quote_list (s_env *env, const s_list *list, s_tag *dest)
{
- s_list *next;
+ s_list *next = NULL;
s_list *tmp = NULL;
s_list **tail = &tmp;
assert(env);
@@ -1461,7 +1461,7 @@ bool env_eval_quote_list (s_env *env, const s_list *list, s_tag *dest)
bool env_eval_quote_map (s_env *env, const s_map *map, s_tag *dest)
{
- s_map tmp;
+ s_map tmp = {0};
uw i = 0;
assert(env);
assert(map);
@@ -1605,7 +1605,7 @@ bool env_eval_quote_tag (s_env *env, const s_tag *tag, s_tag *dest)
bool env_eval_quote_tuple (s_env *env, const s_tuple *tuple, s_tag *dest)
{
uw i = 0;
- s_tuple tmp;
+ s_tuple tmp = {0};
assert(env);
assert(tuple);
assert(dest);
@@ -1626,7 +1626,7 @@ bool env_eval_quote_tuple (s_env *env, const s_tuple *tuple, s_tag *dest)
bool env_eval_quote_unquote (s_env *env, const s_unquote *unquote, s_tag *dest)
{
bool r;
- s_tag tmp;
+ s_tag tmp = {0};
assert(env);
assert(unquote);
assert(dest);
@@ -1654,7 +1654,7 @@ bool env_eval_quote_unquote (s_env *env, const s_unquote *unquote, s_tag *dest)
bool env_eval_str (s_env *env, const s_str *str, s_tag *dest)
{
bool r = true;
- s_tag tmp;
+ s_tag tmp = {0};
if (! str_parse_eval(str, &tmp)) {
err_puts("env_eval_str: invalid Str");
assert(! "env_eval_str: invalid Str");
@@ -1818,7 +1818,7 @@ bool env_eval_tag (s_env *env, const s_tag *tag, s_tag *dest)
bool env_eval_tuple (s_env *env, const s_tuple *tuple, s_tag *dest)
{
uw i = 0;
- s_tuple tmp;
+ s_tuple tmp = {0};
assert(env);
assert(tuple);
assert(dest);
@@ -1901,7 +1901,7 @@ s_tag * env_ident_get (s_env *env, const s_ident *ident, s_tag *dest)
s_tag tag_symbol;
s_tag tag_symbol_value;
s_tag tag_var;
- s_tag tmp;
+ s_tag tmp = {0};
module = ident->module;
if (! module) {
if (! env_sym_search_modules(env, ident->sym, &module) ||
@@ -2001,7 +2001,7 @@ s_ident * env_ident_resolve_module (s_env *env,
const s_ident *ident,
s_ident *dest)
{
- s_ident tmp;
+ s_ident tmp = {0};
assert(env);
assert(ident);
tmp = *ident;
@@ -2138,7 +2138,7 @@ s_tag * env_let (s_env *env, const s_tag *tag, const s_block *block,
{
uw i;
const s_map *map;
- s_tag tmp;
+ s_tag tmp = {0};
assert(env);
assert(tag);
assert(block);
@@ -2196,7 +2196,7 @@ bool env_load (s_env *env, const s_str *path)
s_tag file_path_save;
sw r;
s_tag tag = {0};
- s_tag tmp;
+ s_tag tmp = {0};
assert(env);
assert(path);
if (! buf_init_alloc(&buf, BUF_SIZE))
@@ -2537,8 +2537,8 @@ s_list ** env_module_search_modules (s_env *env,
const s_sym * const *module,
s_list **dest)
{
- s_list *tmp;
- s_list *tmp2;
+ s_list *tmp = {0};
+ s_list *tmp2 = {0};
assert(env);
(void) env;
if (! module || ! *module) {
@@ -2611,7 +2611,7 @@ bool * env_operator_find (s_env *env, const s_ident *op, bool *dest)
s_ident * env_operator_ident (s_env *env, const s_ident *op,
s_ident *dest)
{
- s_ident tmp;
+ s_ident tmp = {0};
assert(env);
assert(op);
assert(dest);
@@ -2690,7 +2690,7 @@ s_ident * env_operator_resolve (s_env *env, const s_ident *op,
s_tag tag_var;
s_tag tag_sym_sym;
s_tag tag_sym_value;
- s_ident tmp;
+ s_ident tmp = {0};
env_ident_resolve_module(env, op, &tmp);
tag_init_sym(&tag_arity, &g_sym_arity);
tag_init_u8( &tag_arity_u8, arity);
@@ -3003,7 +3003,7 @@ f_clean env_struct_type_get_clean (s_env *env, const s_sym *module)
s_tag tag_clean;
s_tag tag_module;
s_tag tag_var;
- f_clean tmp;
+ f_clean tmp = {0};
const s_sym *type;
tag_init_sym(&tag_module, module);
tag_init_sym(&tag_clean, &g_sym_clean);
@@ -3050,7 +3050,7 @@ s_list ** env_struct_type_get_spec (s_env *env,
s_tag tag_defstruct;
s_tag tag_module;
s_tag tag_var;
- s_tag tmp;
+ s_tag tmp = {0};
assert(env);
assert(module);
assert(dest);
@@ -3106,7 +3106,7 @@ bool * env_struct_type_has_spec (s_env *env, const s_sym *module,
bool env_tag_ident_is_bound (s_env *env, const s_tag *tag)
{
- s_tag tmp;
+ s_tag tmp = {0};
assert(tag);
assert(tag->type == TAG_IDENT);
return tag->type == TAG_IDENT &&
@@ -3117,7 +3117,7 @@ bool env_tag_ident_is_bound (s_env *env, const s_tag *tag)
s_tag * env_unwind_protect (s_env *env, s_tag *protected, s_block *cleanup,
s_tag *dest)
{
- s_tag tmp;
+ s_tag tmp = {0};
s_unwind_protect unwind_protect;
assert(env);
assert(protected);
diff --git a/libkc3/facts.c b/libkc3/facts.c
index 2326de5..01353b8 100644
--- a/libkc3/facts.c
+++ b/libkc3/facts.c
@@ -43,7 +43,7 @@ static sw facts_open_log (s_facts *facts, s_buf *buf);
const s_fact * facts_add_fact (s_facts *facts, const s_fact *fact)
{
- s_fact tmp;
+ s_fact tmp = {0};
s_fact *f = NULL;
s_set_item__fact *item;
assert(facts);
diff --git a/libkc3/file.c b/libkc3/file.c
index 82a749e..7129e9d 100644
--- a/libkc3/file.c
+++ b/libkc3/file.c
@@ -138,7 +138,7 @@ s_tag * file_mtime (const s_str *path, s_tag *dest)
#if HAVE_STAT_MTIM
return time_to_tag(&sb.st_mtim, dest);
#else
- s_time tmp;
+ s_time tmp = {0};
tmp.tv_sec = sb.st_mtime;
tmp.tv_nsec = 0;
return time_to_tag(&tmp, dest);
@@ -185,7 +185,7 @@ s_str * file_search (const s_str *suffix, const s_sym *mode,
sw r;
s_buf_save save;
const s_str *str;
- s_str tmp;
+ s_str tmp = {0};
buf_init(&buf, false, PATH_MAX, buf_s);
if ((r = buf_write_str(&buf, &g_kc3_env.argv0_dir)) < 0)
return NULL;
diff --git a/libkc3/fn_clause.c b/libkc3/fn_clause.c
index c30dd05..64cbcab 100644
--- a/libkc3/fn_clause.c
+++ b/libkc3/fn_clause.c
@@ -61,9 +61,8 @@ s_fn_clause * fn_clause_new (s_fn_clause *next_clause)
s_fn_clause * fn_clause_new_copy (const s_fn_clause *src)
{
- s_fn_clause *tmp;
- s_fn_clause **tail;
- tmp = NULL;
+ s_fn_clause *tmp = NULL;
+ s_fn_clause **tail = NULL;
tail = &tmp;
while (src) {
*tail = fn_clause_new(NULL);
diff --git a/libkc3/ident.c b/libkc3/ident.c
index c2263b9..c38aa46 100644
--- a/libkc3/ident.c
+++ b/libkc3/ident.c
@@ -72,7 +72,7 @@ s_ident * ident_init (s_ident *ident, const s_sym *module,
s_ident * ident_init_1 (s_ident *ident, const char *p)
{
- s_str tmp;
+ s_str tmp = {0};
str_init_1(&tmp, NULL, p);
str_to_ident(&tmp, ident);
return ident;
diff --git a/libkc3/inspect.c b/libkc3/inspect.c
index d446e08..d714bb6 100644
--- a/libkc3/inspect.c
+++ b/libkc3/inspect.c
@@ -18,7 +18,7 @@
s_str * inspect_sym (const s_sym *sym, s_str *dest)
{
sw size;
- s_buf tmp;
+ s_buf tmp = {0};
size = buf_inspect_sym_size(&sym);
if (size < 0) {
assert(! "error");
diff --git a/libkc3/kc3.c b/libkc3/kc3.c
index a8beb90..9eabf09 100644
--- a/libkc3/kc3.c
+++ b/libkc3/kc3.c
@@ -104,7 +104,7 @@ s_tag * kc3_defoperator (const s_sym **name, const s_sym **sym,
s_tag * kc3_defstruct (const s_list * const *spec, s_tag *dest)
{
- s_tag tmp;
+ s_tag tmp = {0};
assert(spec);
if (! spec)
return NULL;
@@ -174,7 +174,7 @@ s_tag * kc3_if_then_else (const s_tag *cond, const s_tag *then,
const s_tag *else_, s_tag *dest)
{
bool b;
- s_tag tmp;
+ s_tag tmp = {0};
const s_sym *type;
if (! env_eval_tag(&g_kc3_env, cond, &tmp))
return NULL;