On Tue, Mar 28, 2023 at 6:25 PM Bram Moolenaar <b...@moolenaar.net> wrote:
>
>
> Tony wrote:
>
> > I noticed this in a "make reconfig" at patchlevel 9.0.1429. It may or
> > may not have happened earlier. Builds without expression evaluation
> > are not affected.
> >
> > The following is from a Normal build without the -j argument to make,
> > to avoid line-interlacing from builds of different modules:
> >
> > 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/libpng16 -I/usr/include/pixman-1
> > -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/at-spi-2.0 -I/usr/include/dbus-1.0
> > -I/usr/lib64/dbus-1.0/include -pthread    -O2 -fno-strength-reduce
> > -Wall -Wno-deprecated-declarations -D_REENTRANT -U_FORTIFY_SOURCE
> > -D_FORTIFY_SOURCE=1        -o objects/memline.o memline.c
> > memline.c: In function ‘adjust_text_props_for_delete’:
> > memline.c:3623:43: warning: ‘this_props_len’ may be used uninitialized
> > [-Wmaybe-uninitialized]
> >  3623 |             for (done_this = 0; done_this < this_props_len;
> >       |                                 ~~~~~~~~~~^~~~~~~~~~~~~~~~
>
> I cannot make this warning show up.  I did add the "-O2" argument to
> gcc, that usually reveals these "may be used uninitialized" warnings.
> I assume you use a different version of gcc.  I'm afraid I cannot guess
> what would be the best way to get rid of these warnings.  It looks like
> the optimizer doesn't see that "did_get_line" is FALSE at first and the
> block that sets the variables will always be executed before they are
> used.

At this moment, my gcc version is 13-1.2-x86_64 and my OS is openSUSE
Tumbleweed, snapshot 20230326. Also installed are, among others,
gcc13, cpp13 and libstdc++6-devel-gcc13, all at version
13.0.1+git6669-1.1-x86_64.

The answer to "gcc --version" is
gcc (SUSE Linux) 13.0.1 20230314 (experimental) [revision
42630fadbe248717859d61c0244c821c32b4e52c]
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

>
> Can someone reproduce the warning and come up with a reasonable solution?
> I don't think initializing the variables is a good solution, that should
> not be necessary.

As long as warning messages don't prevent production of an executable
program, and as long as that executable does what I expect of it in
terms of editing properly and not crashing, I can live with them; but
I know that you prefer not having the compiler's output cluttered with
useless warnings. I suppose that changing the Makefile to compile all
modules with -Wno-maybe-uninitialized is not an option because when
this message appears it should usually be looked into.

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 vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/CAJkCKXuXUx5YOjNpjrJM3ijxKTBjk2Rh9UeEyDaXcd6ocT21dA%40mail.gmail.com.

Raspunde prin e-mail lui