After applying patches 8.2 4988 to 4991: -Wmaybe-uninitialized in vim9execute.c in Huge, Big and Normal builds

7 views
Skip to first unread message

Tony Mechelynck

unread,
May 21, 2022, 1:15:47 PM5/21/22
to Bram Moolenaar, vim_dev
Using gcc 12.1.0 on openSUSE Tumbleweed:

gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK
-I/usr/include/gtk-3.0 -I/usr/include/pango-1.0
-I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include
-I/usr/include/harfbuzz -I/usr/include/freetype2
-I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi
-I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libpng16
-I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gio-unix-2.0
-I/usr/include/wayland -I/usr/include/libxkbcommon
-I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0
-I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include
-I/usr/include/at-spi-2.0 -pthread -O2 -fno-strength-reduce -Wall
-Wno-deprecated-declarations -D_REENTRANT -U_FORTIFY_SOURCE
-D_FORTIFY_SOURCE=1 -o objects/vim9execute.o vim9execute.c
vim9execute.c: In function ‘ex_disassemble’:
vim9execute.c:6319:5: warning: ‘instr_count’ may be used uninitialized
[-Wmaybe-uninitialized]
6319 | list_instructions("", instr, instr_count, ufunc);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim9execute.c:6283:17: note: ‘instr_count’ was declared here
6283 | int instr_count;
| ^~~~~~~~~~~
vim9execute.c:6319:5: warning: ‘instr’ may be used uninitialized
[-Wmaybe-uninitialized]
6319 | list_instructions("", instr, instr_count, ufunc);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim9execute.c:6282:18: note: ‘instr’ was declared here
6282 | isn_T *instr;
| ^~~~~


Best regards,
Tony.

Bram Moolenaar

unread,
May 21, 2022, 1:57:30 PM5/21/22
to vim...@googlegroups.com, Tony Mechelynck
Hmm, you would think that the switch on enum compiletype_T would
indicate all possible paths are covered. But I guess the compiler
takes into account an enum can have another value (in C that's not
actually checked).

--
hundred-and-one symptoms of being an internet addict:
246. You use up your free 1 Gbyte in two days.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages