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=3D1        -o objects/memline.o memline.c
> > > memline.c: In function =E2=80=98adjust_text_props_for_delete=E2=80=99:
> > > memline.c:3623:43: warning: =E2=80=98this_props_len=E2=80=99 may be use=
> d uninitialized
> > > [-Wmaybe-uninitialized]
> > >  3623 |             for (done_this =3D 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.

I'm on Ubuntu, which is using gcc 12.2.0.  It might be a gcc 13 problem.

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

The message may be a valid warning.  But in this case it's just
confusing and might valid warnings go unnoticed.  Thus I try to avoid
them.

-- 
`When any government, or any church for that matter, undertakes to say to
 its subjects, "This you may not read, this you must not see, this you are
 forbidden to know," the end result is tyranny and oppression no matter how
 holy the motives' -- Robert A Heinlein, "If this goes on --"

 /// Bram Moolenaar -- b...@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    ///

-- 
-- 
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/20230329213025.6FC5D1C0B95%40moolenaar.net.

Raspunde prin e-mail lui