In the Huge, Big and Normal builds I get -Wmaybe-uninitialized
warnings for line_attr in drawline.c but they are different in each
case; I don't understand getting a -Wmaybe-uninitialized for a
variable which was given an initial value on the line declaring it.
This is gcc 12.1.1 20220721:
* In the 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:2767:47: warning: ‘line_attr’ may be used uninitialized
[-Wmaybe-uninitialized]
2762 | else if ((
| ~
2763 | # ifdef FEAT_DIFF
| ~~~~~~~~~~~~~~~~~
2764 | wlv.diff_hlf != (hlf_T)0 ||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~
2765 | # endif
| ~~~~~~~
2766 | # ifdef FEAT_TERMINAL
| ~~~~~~~~~~~~~~~~~~~~~
2767 | wlv.win_attr != 0 ||
| ~~~~~~~~~~~~~~~~~~^~
2768 | # endif
| ~~~~~~~
2769 | line_attr != 0
| ~~~~~~~~~~~~~~
2770 | ) && (
| ~
drawline.c:590:17: note: ‘line_attr’ was declared here
590 | int line_attr = 0; // attribute for the whole line
| ^~~~~~~~~
* In the Big 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:590:17: warning: ‘line_attr’ may be used uninitialized
[-Wmaybe-uninitialized]
590 | int line_attr = 0; // attribute for the whole line
| ^~~~~~~~~
* In the Normal 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:2792:39: warning: ‘line_attr’ may be used uninitialized
[-Wmaybe-uninitialized]
2792 | wlv.char_attr = line_attr;
| ~~~~~~~~~~~~~~^~~~~~~~~~~
drawline.c:590:17: note: ‘line_attr’ was declared here
590 | int line_attr = 0; // attribute for the whole line
| ^~~~~~~~~
In the Small and Timy builds, this warning does not appear, but
compilation stops after finding an undefined identifier in ex_docmd.c:
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/ex_docmd.o ex_docmd.c
In file included from ex_docmd.c:14:
ex_docmd.c: In function ‘parse_command_modifiers’:
ex_docmd.c:2851:35: error: ‘e_cannot_use_hash_curly_to_start_comment’
undeclared (first use in this function)
2851 | *errormsg =
_(e_cannot_use_hash_curly_to_start_comment);
|
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim.h:564:25: note: in definition of macro ‘_’
564 | # define _(x) ((char *)(x))
| ^
ex_docmd.c:2851:35: note: each undeclared identifier is reported only
once for each function it appears in
2851 | *errormsg =
_(e_cannot_use_hash_curly_to_start_comment);
|
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim.h:564:25: note: in definition of macro ‘_’
564 | # define _(x) ((char *)(x))
| ^
make: *** [Makefile:3222: objects/ex_docmd.o] Error 1
exit status 2
Sat 6 Aug 21:32:55 CEST 2022
linux-tuxedo:~/.build/vim/vim-hg/src/shadow-tiny #
Best regards,
Tony.
--
--
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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/CAJkCKXtKV2YLo6nbAMu5PF97UZTWGZ4BOVt-fTYdqq%2BzYVCb4Q%40mail.gmail.com.