Dominique Pellé wrote: > Attached patch fixes the following compilation > warnings in vim-7.4.1273 with gcc-.5.2.1 on > Ubuntu MATE 15.10 on raspberry PI2: > > gcc -c -I. -Iproto -DHAVE_CONFIG_H -g -Wall -O3 -Wextra > -Wmissing-prototypes -Wunreachable-code -U_FORTIFY_SOURCE > -D_FORTIFY_SOURCE=1 -o objects/ex_cmds2.o ex_cmds2.c > eval.c: In function ‘f_type’: > eval.c:19666:26: warning: ‘n’ may be used uninitialized in this > function [-Wmaybe-uninitialized] > rettv->vval.v_number = n; > ^ > eval.c: In function ‘f_empty’: > eval.c:10561:26: warning: ‘n’ may be used uninitialized in this > function [-Wmaybe-uninitialized] > rettv->vval.v_number = n; > ^ > eval.c: In function ‘write_viminfo_varlist’: > eval.c:24654:3: warning: ‘s’ may be used uninitialized in this > function [-Wmaybe-uninitialized] > fprintf(fp, "!%s\t%s\t", this_var->di_key, s); > ^
I intentionally removed the "default" from the switch, so that it's easier to find places that need to change when a new variable type is added. I used that when adding VAR_JOB. I don't quite see how the "may be used uninitialized" warning can happen, since all possible enum values are covered. Does this compiler not recognize that? Perhaps it's better to assign a default value, even though it's dead code. -- "Hit any key to continue" it said, but nothing happened after F sharp. /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org /// -- -- 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]. For more options, visit https://groups.google.com/d/optout.
