From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Warnings in mingw64 build on emacs-28 branch Date: Sun, 07 Nov 2021 21:59:08 +0200 Message-ID: <83tugn7n5f.fsf@gnu.org> References: <86y260c9b8.fsf@gmail.com> <83fss880qc.fsf@gnu.org> <86zgqflu0g.fsf@gmail.com> <86tugnlpmo.fsf@gmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33250"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Andy Moreton Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Nov 07 21:04:09 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mjoOe-0008Sc-OH for ged-emacs-devel@m.gmane-mx.org; Sun, 07 Nov 2021 21:04:08 +0100 Original-Received: from [::1] (port=48904 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjoOd-0006GF-JV for ged-emacs-devel@m.gmane-mx.org; Sun, 07 Nov 2021 15:04:07 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:57898) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjoK0-0001qJ-5m for emacs-devel@gnu.org; Sun, 07 Nov 2021 14:59:20 -0500 Original-Received: from [2001:470:142:3::e] (port=54494 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjoJz-0001pe-Rw; Sun, 07 Nov 2021 14:59:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=kvPSSalfCzlQO0NmIT+ByM31z4en1PPKJGzW+DfbzYU=; b=TraOcbCP0Jna CdPnfdwBXD5pDQ78hiFrRl+TYf6oiq/9QhZmjp+pmrcfTvENchGXQYSy7UiVABnq6KKWhiX4CQr1c fv+EfPfoEzFp5EniMxrLFsZp1KMNq778IXuTysvwHskzHMS5945epMuj6iNz6hEpF1vfkGi5DNmDk ia0x3klqxqY7ie4uI9vN2WHlR2PNWDm9BBMeVz5nqPivI5k6he4ut9p3d/sLcvv2EC7DOHddk8EnD AiNWOjXROnsD3D/SPzwbI3mD4E3HzHV1HVMLDI0IpP48TmDZI22LFqL0B/G9vsnP4ZNeaixGK44PR CW9KsHXr+Zt7SyqWIiMLkg==; Original-Received: from [87.69.77.57] (port=4595 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjoJz-0007yd-Ed; Sun, 07 Nov 2021 14:59:19 -0500 In-Reply-To: <86tugnlpmo.fsf@gmail.com> (message from Andy Moreton on Sun, 07 Nov 2021 19:41:51 +0000) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:278983 Archived-At: > From: Andy Moreton > 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.