2017-09-14 12:31 GMT+09:00 Yegappan Lakshmanan <yegapp...@gmail.com>:
> Hi, > > When building the latest sources using "-Wall -Wextra -pedantic", > I see the following warning messages in the terminal.c file: > > terminal.c:2502:6: warning: variable 'bg_rgb' is used uninitialized > whenever > 'if' condition is false [-Wsometimes-uninitialized] > if (id != 0) > ^~~~~~~ > > terminal.c:2521:10: note: uninitialized use occurs here > if (bg_rgb == INVALCOLOR) > ^~~~~~ > > terminal.c:2502:2: note: remove the 'if' if its condition is always true > if (id != 0) > ^~~~~~~~~~~~ > > terminal.c:2500:31: note: initialize the variable 'bg_rgb' to silence this > warning > guicolor_T fg_rgb, bg_rgb; > ^ > = 0 > > terminal.c:2502:6: warning: variable 'fg_rgb' is used uninitialized > whenever > 'if' condition is false [-Wsometimes-uninitialized] > if (id != 0) > ^~~~~~~ > > terminal.c:2519:10: note: uninitialized use occurs here > if (fg_rgb == INVALCOLOR) > ^~~~~~ > > terminal.c:2502:2: note: remove the 'if' if its condition is always true > if (id != 0) > ^~~~~~~~~~~~ > > terminal.c:2500:23: note: initialize the variable 'fg_rgb' to silence this > warning > guicolor_T fg_rgb, bg_rgb; > ^ > = 0 > > 2 warnings generated. > Seems like we need an initialization something like: diff --git a/src/terminal.c b/src/terminal.c index 4e8f370c8..ae2dd3324 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -2501,6 +2501,8 @@ create_vterm(term_T *term, int rows, int cols) if (id != 0) syn_id2colors(id, &fg_rgb, &bg_rgb); + else + fg_rgb = INVALCOLOR, bg_rgb = INVALCOLOR; # ifdef FEAT_GUI if (gui.in_use) Otherwise, I still gets a terminal with a strange background color even after 8.0.1103 is applied. The color varies from terminal and terminal, and from run to run. A little bit amazing and I'd like to call it :fortune instead of :term :) > - Yegappan > Best regards, Kazunobu > > -- > -- > 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 vim_dev+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- -- 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 vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.