After applying patches 9.0.2168 to 9.0.2173 : warning -Wmaybe-uninitialized in vim9cmds.c (not in Tiny)

27 views
Skip to first unread message

Tony Mechelynck

unread,
Dec 16, 2023, 6:50:05 PM12/16/23
to Christian Brabandt, vim_dev
vim9cmds.c: In function ‘compile_defer’:
vim9cmds.c:2051:18: warning: ‘type’ may be used uninitialized
[-Wmaybe-uninitialized]
2051 | else if (check_func_args_from_type(cctx, type, argcount, TRUE,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2052 | arg_start) == FAIL)
| ~~~~~~~~~~
vim9cmds.c:2003:18: note: ‘type’ was declared here
2003 | type_T *type;
| ^~~~


Best regards,
Tony.

Yegappan Lakshmanan

unread,
Dec 16, 2023, 9:26:21 PM12/16/23
to vim...@googlegroups.com, Christian Brabandt
Hi Tony,

Which environment and compiler are you using? I don't see this warning.  "type" is
initialized at line 2027 and used at line 2051.  We can initialize "type" to NULL at line 2003.
But I don't think this is necessary.

Regards,
Yegappan

Ernie Rael

unread,
Dec 16, 2023, 10:08:12 PM12/16/23
to vim...@googlegroups.com

I see this as well. Using gcc. The problem is that the initialization is inside

if (cctx->ctx_skip != SKIP_YES)

It's true that the use is also inside that condition, so there's no real problem (assuming ctx_skip isn't changed by the intervening function calls.

-ernie


Regards,
Yegappan

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


Tony Mechelynck

unread,
Dec 17, 2023, 5:20:18 AM12/17/23
to vim...@googlegroups.com, Christian Brabandt
I am using gcc 13.2.1 20231130 on openSUSE Tumbleweed, and I see this
on all +eval configurations. For instance my "normal" build is defined
as follows:

export CONF_OPT_GUI='--enable-gui=motif'
export CONF_OPT_MULTIBYTE='--enable-multibyte'
export CONF_OPT_AUTOSERVE='--enable-autoservername'
export CONF_OPT_SODIUM='--enable-libsodium'
export CONF_OPT_FEAT='--with-features=normal'
export CONF_ARGS2='--with-vim-name=vim-normal'
export CONF_OPT_COMPBY='"--with-compiledby=antoine.m...@gmail.com"'

I also compile two different "huge" builds (which get the same error)
and two different "tiny" builds (which don't).

Best regards,
Tony.

Yegappan Lakshmanan

unread,
Dec 17, 2023, 11:27:30 AM12/17/23
to vim...@googlegroups.com, Christian Brabandt
Thanks.  I have opened the PR https://github.com/vim/vim/pull/13711 to address this warning.

Regards,
Yegappan

Reply all
Reply to author
Forward
0 new messages