From: Po Lu <luangruo@yahoo.com>
To: Jashank Jeremy <jashank@rulingia.com.au>
Cc: Emacs development list <emacs-devel@gnu.org>
Subject: Re: master 242a4b49cb: Minor cleanups to X drag-and-drop code
Date: Sun, 22 May 2022 15:50:35 +0800 [thread overview]
Message-ID: <87r14mqa44.fsf@yahoo.com> (raw)
In-Reply-To: <87v8tyf434.wl-jashank@rulingia.com.au> (Jashank Jeremy's message of "Sun, 22 May 2022 16:56:15 +1000")
Jashank Jeremy <jashank@rulingia.com.au> writes:
> Whilst chasing down the build failure against e465ea816d, I observed
> some compiler warnings related to this patch:
>
> .../emacs/src/src/xterm.c:1994:7: warning: variable 'data' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
> if (rc)
> ^~
> .../emacs/src/src/xterm.c:2016:7: note: uninitialized use occurs here
> if (data[1] > XM_DRAG_PROTOCOL_VERSION)
> ^~~~
> .../emacs/src/src/xterm.c:1994:3: note: remove the 'if' if its condition is always true
> if (rc)
> ^~~~~~~
> .../emacs/src/src/xterm.c:1977:16: note: initialize the variable 'data' to silence this warning
> uint8_t *data;
> ^
> = NULL
>
> This looks like a plausible issue --- XGetWindowProperty looks to be
> fallible, and in the event it fails we're potentially dereferencing an
> uninitialised value. I suspect the check introduced in this commit
> should be within the immediately preceding region; however, I do not
> know what the implications of such a change would be, and thus won't
> concretely suggest one.
Silly compiler. If rc is true, tmp_data is always initialized.
next prev parent reply other threads:[~2022-05-22 7:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-22 6:56 master 242a4b49cb: Minor cleanups to X drag-and-drop code Jashank Jeremy
2022-05-22 7:50 ` Po Lu [this message]
2022-05-22 7:55 ` Po Lu
-- strict thread matches above, loose matches on Subject: below --
2022-05-20 11:41 Eli Zaretskii
2022-05-20 12:05 ` Po Lu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87r14mqa44.fsf@yahoo.com \
--to=luangruo@yahoo.com \
--cc=emacs-devel@gnu.org \
--cc=jashank@rulingia.com.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.