On Sun, Feb 5, 2023 at 5:03 PM Bram Moolenaar <[email protected]> wrote:
>
>
> Patch 9.0.1283
> Problem:    The code for setting options is too complicated.
> Solution:   Refactor the do_set() function. (Yegappan Lakshmanan, Lewis
>             Russell, closes #11945)
> Files:      src/option.c

Warnings Wmaybe-uninitialized for cp_val and varp in all builds. The
following is from the Tiny build:

linux-tuxedo:~/.build/vim/vim-hg/src/shadow-tiny # (make -j4 || echo
'exit status' $? ; date) 2>&1 |tee -a make.log
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/option.o option.c
In function ‘do_set_string’,
    inlined from ‘do_set_option_value’ at option.c:2047:10,
    inlined from ‘do_set_option’ at option.c:2267:11,
    inlined from ‘do_set’ at option.c:2349:15:
option.c:1471:65: warning: ‘cp_val’ may be used uninitialized
[-Wmaybe-uninitialized]
 1471 |                                                    ?
VI_DEFAULT : VIM_DEFAULT];
option.c: In function ‘do_set’:
option.c:2099:17: note: ‘cp_val’ was declared here
 2099 |     int         cp_val;
      |                 ^~~~~~
In function ‘do_set_option_bool’,
    inlined from ‘do_set_option_value’ at option.c:2020:11,
    inlined from ‘do_set_option’ at option.c:2267:11,
    inlined from ‘do_set’ at option.c:2349:15:
option.c:1850:12: warning: ‘varp’ may be used uninitialized
[-Wmaybe-uninitialized]
 1850 |         if ((int *)varp == &curbuf->b_p_ar && opt_flags == OPT_LOCAL)
      |            ^
option.c: In function ‘do_set’:
option.c:2095:18: note: ‘varp’ was declared here
 2095 |     char_u      *varp;          // pointer to variable for
current option
      |                  ^~~~
gcc -c -I. -Iproto -DHAVE_CONFIG_H     -O2 -fno-strength-reduce -Wall
-Wno-deprecated-declarations -D_REENTRANT -U_FORTIFY_SOURCE
-D_FORTIFY_SOURCE=1        version.c -o objects/version.o
link.sh: $LINK_AS_NEEDED set to 'yes': invoking linker directly.
  gcc   -L/usr/local/lib -Wl,--as-needed        -o vi objects/alloc.o
objects/arabic.o objects/arglist.o objects/autocmd.o objects/beval.o
objects/buffer.o objects/change.o objects/blob.o objects/blowfish.o
objects/cindent.o objects/clientserver.o objects/clipboard.o
objects/cmdexpand.o objects/cmdhist.o objects/crypt.o
objects/crypt_zip.o objects/debugger.o objects/dict.o objects/diff.o
objects/digraph.o objects/drawline.o objects/drawscreen.o
objects/edit.o objects/eval.o objects/evalbuffer.o objects/evalfunc.o
objects/evalvars.o objects/evalwindow.o objects/ex_cmds.o
objects/ex_cmds2.o objects/ex_docmd.o objects/ex_eval.o
objects/ex_getln.o objects/fileio.o objects/filepath.o
objects/findfile.o objects/float.o objects/fold.o objects/getchar.o
objects/gui_xim.o objects/hardcopy.o objects/hashtab.o objects/help.o
objects/highlight.o objects/if_cscope.o objects/if_xcmdsrv.o
objects/indent.o objects/insexpand.o objects/list.o objects/locale.o
objects/logfile.o objects/map.o objects/mark.o objects/match.o
objects/mbyte.o objects/memline.o objects/menu.o objects/misc1.o
objects/misc2.o objects/mouse.o objects/move.o objects/normal.o
objects/ops.o objects/option.o objects/optionstr.o objects/os_unix.o
objects/pathdef.o objects/popupmenu.o objects/popupwin.o
objects/profiler.o objects/pty.o objects/quickfix.o objects/regexp.o
objects/register.o objects/screen.o objects/scriptfile.o
objects/search.o objects/session.o objects/sha256.o objects/sign.o
objects/sound.o objects/spell.o objects/spellfile.o
objects/spellsuggest.o objects/strings.o objects/syntax.o
objects/tag.o objects/term.o objects/terminal.o objects/testing.o
objects/textformat.o objects/textobject.o objects/textprop.o
objects/time.o objects/typval.o objects/ui.o objects/undo.o
objects/usercmd.o objects/userfunc.o objects/version.o
objects/vim9class.o objects/vim9cmds.o objects/vim9compile.o
objects/vim9execute.o objects/vim9expr.o objects/vim9instr.o
objects/vim9script.o objects/vim9type.o objects/viminfo.o
objects/window.o objects/bufwrite.o              objects/charset.o
objects/json.o objects/main.o objects/memfile.o objects/message.o
-lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE  -lm -ltinfo -lelf
-lselinux -lgpm
link.sh: Linked fine
Sun  5 Feb 17:33:03 CET 2023
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/CAJkCKXua8FbHwA-Pq1AgO_fmOoeCowW0Ks1cgnmYxdRfHSvmuQ%40mail.gmail.com.

Raspunde prin e-mail lui