emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: emacs-28 e5a49f44ff: * src/emacs.c (load_pdump): Fix use of xpalloc.


From: Andreas Schwab
Subject: Re: emacs-28 e5a49f44ff: * src/emacs.c (load_pdump): Fix use of xpalloc.
Date: Tue, 04 Oct 2022 18:34:12 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)

On Okt 04 2022, Stefan Kangas wrote:

> This change leads to the below on macOS 10.13, using Apple LLVM
> version 10.0.0 (clang-1000.10.44.4):
>
> emacs.c:899:7: warning: variable 'bufsize' is used uninitialized
> whenever 'if' condition is true [-Wsometimes-uninitialized]
>   if (!(emacs_executable && *emacs_executable))
>       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> emacs.c:964:7: note: uninitialized use occurs here
>   if (bufsize < needed)
>       ^~~~~~~
> emacs.c:899:3: note: remove the 'if' if its condition is always false
>   if (!(emacs_executable && *emacs_executable))
>   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> emacs.c:928:3: note: variable 'bufsize' is declared here
>   ptrdiff_t bufsize = exenamelen + strlen (suffix) + 1;
>   ^
> 1 warning generated.

This was broken even before, since dump_file wasn't heap-allocated
before this point if the jump to hardcoded happend.

Should be fixed now.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]