From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Compiler warnings in dispnew.c Date: Mon, 29 Nov 2021 12:49:56 -0500 Message-ID: References: <87fsrg7gdt.fsf.ref@yahoo.com> <87fsrg7gdt.fsf@yahoo.com> <83tufwwo7z.fsf@gnu.org> <87bl247dbn.fsf@yahoo.com> <87wnksfsiy.fsf@linux-m68k.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17000"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Po Lu , Eli Zaretskii , emacs-devel@gnu.org To: Andreas Schwab Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Nov 29 18:51:29 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 1mrkoL-0004CQ-Gq for ged-emacs-devel@m.gmane-mx.org; Mon, 29 Nov 2021 18:51:29 +0100 Original-Received: from localhost ([::1]:42418 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mrkoJ-0001yC-Nc for ged-emacs-devel@m.gmane-mx.org; Mon, 29 Nov 2021 12:51:27 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:37018) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mrkmy-00018V-Ga for emacs-devel@gnu.org; Mon, 29 Nov 2021 12:50:04 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:4561) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mrkmv-0005zh-CN; Mon, 29 Nov 2021 12:50:03 -0500 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id E91F344084E; Mon, 29 Nov 2021 12:49:57 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id B5BC84407EC; Mon, 29 Nov 2021 12:49:56 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1638208196; bh=tEw7K4pG2EiCBkz7rCk+AecD+nIeZniaB9Xc1Yc8tSk=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=lUJjElt1jTGrCbTWr3RmxTyb9RLt791NrAg0OeZICDhhPjFIqP28AElrzSzCqsYbq dkoMKA/C/VG7cayN4B738hlQamPMWCjmDrTaN5bwgW3tLCtdFhkw4YKuP9Goi2bSoM ppaIEVhMdQtsc/WH4aNDVbf+xc0WUzrRPa9tFFWjk4j8wEfMZJItIte53ToywjA6rj cPnlKZDJ2zg3VfDEqkzGSm74h2mLNtPTQlgBOS1Cia+dAsXa0At7ONLZ/TUf8dDyXQ 6SLnFopwojud+IAzphEyY+MlfOLW2re/tBt9Rzkevy8td4qd0A1BD6VjMAvz68htnZ cESLDLYmZdCdA== Original-Received: from alfajor (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 99F41120476; Mon, 29 Nov 2021 12:49:56 -0500 (EST) In-Reply-To: <87wnksfsiy.fsf@linux-m68k.org> (Andreas Schwab's message of "Sun, 28 Nov 2021 12:07:01 +0100") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:280499 Archived-At: Andreas Schwab [2021-11-28 12:07:01] wrote: > - memcpy (&to->x, &from->x, sizeof *to - off); > + memcpy ((char *) to + off, (char *) from + off, sizeof *to - off); I wonder: is the (char*) cast sufficient or is it necessary to "obfuscate" the code by writing `to + off` instead of `&to->x`? [ By "obfuscate" I mean here to hide from the compiler, rather than from humans, because I'm not sure which of the two is more clear to a human, here. ] Stefan