Hi All,
After updating my sources from 8.1.1017 up to 8.2.1033, mingw64 (gcc
10.1.1) started throwing this warning:
<snip>
gcc -c -I. -Iproto -DWIN32 -DWINVER=0x0603 -D_WIN32_WINNT=0x0603
-DHAVE_PATHDEF -DFEAT_NORMAL -DHAVE_STDINT_H -pipe -march=native -Wall
-O3 -fomit-frame-pointer -freg-struct-return -fpie -fPIE
-DFEAT_GUI_MSWIN -DFEAT_CLIPBOARD vim9compile.c -o gobjnative/vim9compile.o
vim9compile.c: In function 'compile_expr1':
vim9compile.c:4443:6: warning: 'type1' may be used uninitialized in this
function [-Wmaybe-uninitialized]
4443 | common_type(type1, type2, &type2, cctx->ctx_type_list);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim9compile.c:4446:38: warning: 'end_idx' may be used uninitialized in
this function [-Wmaybe-uninitialized]
4446 | isn = ((isn_T *)instr->ga_data) + end_idx;
| ^
</snip>
I'm not sure which patch is causing gcc to have a little fit, but the
attached patch tries to calm it down.
Note that I defaulted a few extra variables just to make it consistent.
Cheers
John
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/82027826-3e15-2e5e-dd40-bfae6d8d844e%40internode.on.net.
--- vim9compile.c.orig 2020-06-22 05:15:09.950854200 +1000
+++ vim9compile.c 2020-06-22 05:20:50.985503700 +1000
@@ -4357,10 +4357,10 @@
garray_T *instr = &cctx->ctx_instr;
garray_T *stack = &cctx->ctx_type_stack;
int alt_idx = instr->ga_len;
- int end_idx;
- isn_T *isn;
- type_T *type1;
- type_T *type2;
+ int end_idx = 0;
+ isn_T *isn = NULL;
+ type_T *type1 = NULL;
+ type_T *type2 = NULL;
int has_const_expr = FALSE;
int const_value = FALSE;
int save_skip = cctx->ctx_skip;