From: Eli Zaretskii <eliz@gnu.org>
To: Andy Moreton <andrewjmoreton@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: Warnings in mingw64 build on emacs-28 branch
Date: Sun, 07 Nov 2021 21:59:08 +0200 [thread overview]
Message-ID: <83tugn7n5f.fsf@gnu.org> (raw)
In-Reply-To: <86tugnlpmo.fsf@gmail.com> (message from Andy Moreton on Sun, 07 Nov 2021 19:41:51 +0000)
> From: Andy Moreton <andrewjmoreton@gmail.com>
> Date: Sun, 07 Nov 2021 19:41:51 +0000
>
> In set_frame_menubar from w32menu.c, this shows the warning:
>
> memcpy (previous_items, XVECTOR (f->menu_bar_vector)->contents,
> previous_menu_items_used * word_size);
>
> ...and this placates the compiler:
>
> memcpy (previous_items, xvector_contents (f->menu_bar_vector),
> previous_menu_items_used * word_size);
That doesn't explain why we don't need the same in the other places
where memcpy and XVECTOR are used exactly like in w32menu.c, at least
AFAICT.
What your trick does is hide XVECTOR behind enough indirections for
the compiler to lose sight of what is going on. That is fine, but as
compilers look deeper and deeper, this trick will one day cease to be
enough. Thus, I'd still prefer to understand why the other calls of
memcpy don't trigger similar warnings.
Thanks.
next prev parent reply other threads:[~2021-11-07 19:59 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-07 14:46 Warnings in mingw64 build on emacs-28 branch Andy Moreton
2021-11-07 15:05 ` Eli Zaretskii
2021-11-07 15:51 ` Óscar Fuentes
2021-11-07 18:39 ` Eli Zaretskii
2021-11-07 19:25 ` Óscar Fuentes
2021-11-07 19:30 ` Eli Zaretskii
2021-11-07 19:57 ` Óscar Fuentes
2021-11-07 20:02 ` Eli Zaretskii
2021-11-07 18:07 ` Andy Moreton
2021-11-07 19:41 ` Andy Moreton
2021-11-07 19:59 ` Eli Zaretskii [this message]
2021-11-07 20:55 ` Andy Moreton
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=83tugn7n5f.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=andrewjmoreton@gmail.com \
--cc=emacs-devel@gnu.org \
/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.