Warnings -Wmaybe-uninitialized in highlight.c, screen.c (twice) and term.c after applying patches 9.2.0090 to 9.2.0096

6 views
Skip to first unread message

Tony Mechelynck

unread,
Mar 2, 2026, 8:17:16 PM (2 days ago) Mar 2
to vim_dev, Christian Brabandt
In all builds, but link proceeds normally.

The following is from my "full-featured" huge build:

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/cairo
-I/usr/include/gdk-pixbuf-2.0 -I/usr/include/glycin-2
-I/usr/include/libseccomp -I/usr/include/at-spi2-atk/2.0
-I/usr/include/at-spi-2.0 -I/usr/include/atk-1.0
-I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include
-I/usr/include/libxkbcommon -I/usr/include/wayland
-I/usr/include/fribidi -I/usr/include/libpng16 -I/usr/include/pixman-1
-I/usr/include/harfbuzz -I/usr/include/freetype2
-I/usr/include/gio-unix-2.0 -I/usr/include/glib-2.0
-I/usr/lib64/glib-2.0/include -I/usr/include/libmount
-I/usr/include/blkid -O2 -fno-strength-reduce -Wall
-Wno-deprecated-declarations -D_REENTRANT -U_FORTIFY_SOURCE
-D_FORTIFY_SOURCE=1 -o objects/highlight.o highlight.c
highlight.c: In function ‘highlight_changed’:
highlight.c:4360:32: warning: ‘id’ may be used uninitialized
[-Wmaybe-uninitialized]
4360 | highlight_ids[hlf] = id;
| ~~~~~~~~~~~~~~~~~~~^~~~
highlight.c:4244:17: note: ‘id’ was declared here
4244 | int id;
| ^~

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/cairo
-I/usr/include/gdk-pixbuf-2.0 -I/usr/include/glycin-2
-I/usr/include/libseccomp -I/usr/include/at-spi2-atk/2.0
-I/usr/include/at-spi-2.0 -I/usr/include/atk-1.0
-I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include
-I/usr/include/libxkbcommon -I/usr/include/wayland
-I/usr/include/fribidi -I/usr/include/libpng16 -I/usr/include/pixman-1
-I/usr/include/harfbuzz -I/usr/include/freetype2
-I/usr/include/gio-unix-2.0 -I/usr/include/glib-2.0
-I/usr/lib64/glib-2.0/include -I/usr/include/libmount
-I/usr/include/blkid -O2 -fno-strength-reduce -Wall
-Wno-deprecated-declarations -D_REENTRANT -U_FORTIFY_SOURCE
-D_FORTIFY_SOURCE=1 -o objects/screen.o screen.c
screen.c: In function ‘draw_tabline’:
screen.c:4567:17: warning: ‘attr_nosel’ may be used uninitialized
[-Wmaybe-uninitialized]
4567 | int attr_nosel;
| ^~~~~~~~~~
screen.c:4722:9: warning: ‘attr_fill’ may be used uninitialized
[-Wmaybe-uninitialized]
4722 | screen_fill(0, 1, col, (int)Columns, c, c, attr_fill);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
screen.c:4568:17: note: ‘attr_fill’ was declared here
4568 | int attr_fill;
| ^~~~~~~~~

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/cairo
-I/usr/include/gdk-pixbuf-2.0 -I/usr/include/glycin-2
-I/usr/include/libseccomp -I/usr/include/at-spi2-atk/2.0
-I/usr/include/at-spi-2.0 -I/usr/include/atk-1.0
-I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include
-I/usr/include/libxkbcommon -I/usr/include/wayland
-I/usr/include/fribidi -I/usr/include/libpng16 -I/usr/include/pixman-1
-I/usr/include/harfbuzz -I/usr/include/freetype2
-I/usr/include/gio-unix-2.0 -I/usr/include/glib-2.0
-I/usr/lib64/glib-2.0/include -I/usr/include/libmount
-I/usr/include/blkid -O2 -fno-strength-reduce -Wall
-Wno-deprecated-declarations -D_REENTRANT -U_FORTIFY_SOURCE
-D_FORTIFY_SOURCE=1 -o objects/term.o term.c
term.c: In function ‘check_termcode’:
term.c:6433:22: warning: ‘keypad_slen_found’ may be used uninitialized
[-Wmaybe-uninitialized]
6433 | slen = keypad_slen_found;
| ~~~~~^~~~~~~~~~~~~~~~~~~
term.c:6260:17: note: ‘keypad_slen_found’ was declared here
6260 | int keypad_slen_found;
| ^~~~~~~~~~~~~~~~~

Best regards,
Tony.

Christian Brabandt

unread,
Mar 3, 2026, 8:23:48 AM (24 hours ago) Mar 3
to Tony Mechelynck, vim_dev
Hi Tony,
yes, Coverity also caught this. This should be fixed with PR 19561

Thanks,
Chris
Reply all
Reply to author
Forward
0 new messages