emacs-devel
[Top][All Lists]
Advanced

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

Re: Warnings in mingw64 build on emacs-28 branch


From: Eli Zaretskii
Subject: Re: Warnings in mingw64 build on emacs-28 branch
Date: Sun, 07 Nov 2021 21:59:08 +0200

> 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.



reply via email to

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