Commit 89697be84bb3560ed9b17af31882ef048bba1386

Thomas de Grivel 2024-07-28T05:25:58

tmp = {0}

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
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;