[vim/vim] New compiler warnings in 9.1.444 (Issue #14847)

17 views
Skip to first unread message

chdiza

unread,
May 25, 2024, 8:56:44 AMMay 25
to vim/vim, Subscribed

Steps to reproduce

Run ./configure with the following flags:

--with-x
--enable-gui=gtk3
--x-includes=/usr/include/x86_64-linux-gnu
--x-libraries=/lib/x86_64-linux-gnu
--disable-netbeans
--disable-nls

Then do make -j4.

Observe the following warning that wasn't there a couple of days ago:

eval.c: In function ‘echo_string_core’:
cc1: warning: function may return address of local variable [-Wreturn-local-addr]
eval.c:5741:17: note: declared here
 5741 |     char_u      buf[MAX_FUNC_NAME_LEN];
      |                 ^~~

Expected behaviour

I expect that no warnings are emitted during the make phase.

Version of Vim

9.1.444

Environment

OS: Linux Mint 21.1
Shell: Bash
Terminal: Kitty

Logs and stack traces

No response


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/14847@github.com>

Christian Brabandt

unread,
May 25, 2024, 2:22:55 PMMay 25
to vim/vim, Subscribed

I noticed this to with gcc-10. I stared at it for a while and couldn't make sense of it. It only seems to occur when compiling with -O2 (which is unfortunately the default). I suspect a false positive here, because it doesn't appear when compiling with -O (or when compiling with clang) and the code seems correct. However I am not sure if the optimizer optimizes the code wrongly and then the warning is justified (and this is an actual issue with the optimized code). So I am not sure what to do against it.

It's the reason I commited 95ff39f to make sure coverity still works.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/14847/2131384113@github.com>

Christian Brabandt

unread,
May 27, 2024, 11:20:48 AMMay 27
to vim/vim, Subscribed

BTW: what gcc version are you using? I see it with gcc-10 on my default Debian bulleye work-station. On a bookworm with gcc-13, I don't see this warning.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/14847/2133686155@github.com>

chdiza

unread,
May 27, 2024, 11:34:53 AMMay 27
to vim/vim, Subscribed

$ gcc --version
gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/14847/2133707373@github.com>

Christian Brabandt

unread,
May 27, 2024, 11:43:44 AMMay 27
to vim/vim, Subscribed

I don't see it with gcc-13. and gcc-12. Seems an issue with gcc-10 and gcc-11 then. Does the workaround of export CFLAGS=-O and then configure, make work for you?


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/14847/2133721844@github.com>

chdiza

unread,
May 27, 2024, 5:42:31 PMMay 27
to vim/vim, Subscribed

That workaround does seem to prevent the warning. I'm not sure whether I should use that workaround; without the workaround and with the warning, vim ends up compiling anyway.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/14847/2134072480@github.com>

Christian Brabandt

unread,
May 29, 2024, 1:55:24 AMMay 29
to vim/vim, Subscribed

Closed #14847 as completed via 8904d67.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issue/14847/issue_event/12966195825@github.com>

Reply all
Reply to author
Forward
0 new messages