Re: Compilation warnings in builds with expression evaluation

2023-03-28 Fir de Conversatie Tony Mechelynck
On Tue, Mar 28, 2023 at 6:25 PM Bram Moolenaar  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.


Failure using "g:" as a dict

2023-03-28 Fir de Conversatie Ernie Rael

Doing

   vim -c 'vim9cmd g:["my-output-dir"] = "vglob-dir"'

give this error

   Error detected while processing command line:
   E461: Illegal variable name: my-output-dir

Turns out

   vim9script
   g:["foo-bar"] = "baz"

also fails.

-ernie

--
--
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/9764aaf4-fb0e-f718-7955-4dac257d83a9%40raelity.com.


Patch 9.0.1430

2023-03-28 Fir de Conversatie Bram Moolenaar


Patch 9.0.1430
Problem:Livebook files are not recognized.
Solution:   Add a pattern for Livebook files. (Mathias Jean Johansen,
closes #12203)
Files:  runtime/filetype.vim, src/testdir/test_filetype.vim


*** ../vim-9.0.1429/runtime/filetype.vim2023-03-23 15:45:42.804274880 
+
--- runtime/filetype.vim2023-03-28 21:23:34.757482340 +0100
***
*** 1162,1167 
--- 1162,1170 
  " LiteStep RC files
  au BufNewFile,BufRead */LiteStep/*/*.rc   setf litestep
  
+ " Livebook
+ au BufNewFile,BufRead *.livemdsetf livebook
+ 
  " Login access
  au BufNewFile,BufRead */etc/login.access  setf loginaccess
  
*** ../vim-9.0.1429/src/testdir/test_filetype.vim   2023-03-23 
15:45:42.804274880 +
--- src/testdir/test_filetype.vim   2023-03-28 21:24:11.809616418 +0100
***
*** 336,341 
--- 336,342 
  \ 'lite': ['file.lite', 'file.lt'],
  \ 'litestep': ['/LiteStep/any/file.rc', 'any/LiteStep/any/file.rc'],
  \ 'logcheck': ['/etc/logcheck/file.d-some/file', 
'/etc/logcheck/file.d/file', 'any/etc/logcheck/file.d-some/file', 
'any/etc/logcheck/file.d/file'],
+ \ 'livebook': ['file.livemd'],
  \ 'loginaccess': ['/etc/login.access', 'any/etc/login.access'],
  \ 'logindefs': ['/etc/login.defs', 'any/etc/login.defs'],
  \ 'logtalk': ['file.lgt'],
*** ../vim-9.0.1429/src/version.c   2023-03-26 21:27:21.222798864 +0100
--- src/version.c   2023-03-28 21:23:07.285376916 +0100
***
*** 697,698 
--- 697,700 
  {   /* Add new patch number below this line */
+ /**/
+ 1430,
  /**/

-- 
ARTHUR:  Well, I AM king...
DENNIS:  Oh king, eh, very nice.  An' how'd you get that, eh?  By exploitin'
 the workers -- by 'angin' on to outdated imperialist dogma which
 perpetuates the economic an' social differences in our society!  If
 there's ever going to be any progress--
  The Quest for the Holy Grail (Monty Python)

 /// 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/20230328202904.50B931C128F%40moolenaar.net.


using vim to run vim9script

2023-03-28 Fir de Conversatie Ernie Rael

I want to run some vim stuff from a shell script.

Some issues I can think of

 * passing arguments to vim
 * don't draw a screen
 * seeing output
 * seeing errors

The following more or less works; it would be nice
if vim, on an error, automatically exited with an error;
"echo g:what" in this case.

Looking for suggestions and/or alternatives and/or doc ref?

Thanks,
-ernie

Doing:

   ex -s -c 'let g:arg = 123' -c 'redir >> /dev/stdout' -c 'source t.vim'

where t.vim is

   vim9script
   echo g:arg
   echo 'foo'
   echo g:what
   echo "\n"
   q

produces the output

   123
   foo
   Error detected while processing command line..script /.../t.vim:
   line    4:
   E121: Undefined variable: g:what
   Entering Ex mode.  Type "visual" to go to Normal mode.


--
--
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/6443a0af-f327-43ec-b6ee-49f855466fe7%40raelity.com.


Re: Compilation warnings in builds with expression evaluation

2023-03-28 Fir de Conversatie Bram Moolenaar


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.

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.

-- 
CUSTOMER: Well, can you hang around a couple of minutes?  He won't be
  long.
MORTICIAN:Naaah, I got to go on to Robinson's -- they've lost nine today.
CUSTOMER: Well, when is your next round?
MORTICIAN:Thursday.
DEAD PERSON:  I think I'll go for a walk.
  The Quest for the Holy Grail (Monty Python)

 /// 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/20230328162503.83B261C0B95%40moolenaar.net.


Vim incorrectly highlighted initializer list as error inside subscript in C++

2023-03-28 Fir de Conversatie ????
Vim incorrectly highlighted initialized list as error inside subscript in C++.


Take this code snippet for example:


std::maphttp://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/tencent_48319B7BC1C88C517453A80C88BC9AE82D09%40qq.com.