Warning in drawline.c after applying patches 9.0.67 to 71

5 views
Skip to first unread message

Tony Mechelynck

unread,
Jul 25, 2022, 3:28:44 PM7/25/22
to Bram Moolenaar, vim_dev
The following (as shown for Big) also appears in 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/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/drawline.o drawline.c
drawline.c: In function ‘win_line’:
drawline.c:858:16: warning: ‘charsize’ may be used uninitialized
[-Wmaybe-uninitialized]
858 | if (( (*mb_ptr2cells)(ptr) >= charsize || *ptr ==
TAB) && col == 0)
| ^
drawline.c:822:25: note: ‘charsize’ was declared here
822 | int charsize;
| ^~~~~~~~
drawline.c:1541:35: warning: ‘used_tpi’ may be used uninitialized
[-Wmaybe-uninitialized]
1541 | text_props[used_tpi].tp_id = -MAXCOL;
| ^
drawline.c:1489:25: note: ‘used_tpi’ was declared here
1489 | int used_tpi;
| ^~~~~~~~


Normal has only the first of these (for line 858) but not the other
(for line 1541).
Tiny and Small have a different warning:

gcc -c -I. -Iproto -DHAVE_CONFIG_H -O2 -fno-strength-reduce -Wall
-Wno-deprecated-declarations -D_REENTRANT -U_FORTIFY_SOURCE
-D_FORTIFY_SOURCE=1 -o objects/drawline.o drawline.c
drawline.c: In function ‘win_line’:
drawline.c:854:18: warning: ‘charsize’ may be used uninitialized
[-Wmaybe-uninitialized]
854 | vcol -= charsize;
| ^~
drawline.c:822:25: note: ‘charsize’ was declared here
822 | int charsize;
| ^~~~~~~~


Best regards,
Tony.

Bram Moolenaar

unread,
Jul 25, 2022, 5:01:34 PM7/25/22
to vim...@googlegroups.com, Tony Mechelynck

> The following (as shown for Big) also appears in 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/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=3D1 -o objects/drawline.o drawline.c
> drawline.c: In function =E2=80=98win_line=E2=80=99:
> drawline.c:858:16: warning: =E2=80=98charsize=E2=80=99 may be used uninitia=
> lized
> [-Wmaybe-uninitialized]
> 858 | if (( (*mb_ptr2cells)(ptr) >=3D charsize || *ptr =3D=3D
> TAB) && col =3D=3D 0)
> | ^
> drawline.c:822:25: note: =E2=80=98charsize=E2=80=99 was declared here
> 822 | int charsize;
> | ^~~~~~~~
> drawline.c:1541:35: warning: =E2=80=98used_tpi=E2=80=99 may be used uniniti=
> alized
> [-Wmaybe-uninitialized]
> 1541 | text_props[used_tpi].tp_id =3D -MAXCOL;
> | ^
> drawline.c:1489:25: note: =E2=80=98used_tpi=E2=80=99 was declared here
> 1489 | int used_tpi;
> | ^~~~~~~~

Should be fixed by patch 9.0.0072

--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?

/// 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