From patchwork Wed Nov 27 22:44:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 11265041 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B6AD213A4 for ; Wed, 27 Nov 2019 22:45:40 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 902F1215F2 for ; Wed, 27 Nov 2019 22:45:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="LWUy3DJs" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 902F1215F2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ia63J-00065w-4z; Wed, 27 Nov 2019 22:44:53 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ia63H-00065m-Q9 for xen-devel@lists.xenproject.org; Wed, 27 Nov 2019 22:44:51 +0000 X-Inumbo-ID: 85a3a068-1167-11ea-a55d-bc764e2007e4 Received: from mail.kernel.org (unknown [198.145.29.99]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 85a3a068-1167-11ea-a55d-bc764e2007e4; Wed, 27 Nov 2019 22:44:51 +0000 (UTC) Received: from localhost (c-67-164-102-47.hsd1.ca.comcast.net [67.164.102.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 49386206E0; Wed, 27 Nov 2019 22:44:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574894690; bh=OWiWVvECwqBlywG2/Vv1jjd7T1xj+HhhMOGVEwCoCJw=; h=Date:From:To:cc:Subject:From; b=LWUy3DJsAC9zVkZ7GUr1PSc93FpAvR9tMMiTmnvuitMWJ1N0aUon8RAZgd2PbzJs3 BtNqjmXoLs8aoyD6Aj25peCUwso2zkzjb+CgrwJDQKE5dXgEPvvehZb0KNcdBh9ev5 iau3cCh8amJuZ4Lm8UMjKY4Bqnz0ytVBmPLKc+kQ= Date: Wed, 27 Nov 2019 14:44:49 -0800 (PST) From: Stefano Stabellini X-X-Sender: sstabellini@sstabellini-ThinkPad-T480s To: xen-devel@lists.xenproject.org Message-ID: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Subject: [Xen-devel] RFC disable GCC 9 -Waddress-of-packed-member X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: sstabellini@kernel.org, julien@xen.org, wl@xen.org, konrad.wilk@oracle.com, George.Dunlap@eu.citrix.com, andrew.cooper3@citrix.com, ian.jackson@eu.citrix.com, jbeulich@suse.com Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Hi all, GCC 9 introduced a new warning: address-of-packed-member. It warns when a pointer points to a member of a packed struct, leading to a build failure in Xen (cross compiling Xen on Arm with GCC 9.2): 556 trace.c: In function '__trace_hypercall': 557 trace.c:826:19: error: taking address of packed member of 'struct ' may result in an unaligned pointer value [-Werror=address-of-packed-member] 558 826 | uint32_t *a = d.args; Looking at the code, I cannot see anything wrong with what we are doing. At least on Arm, it looks OK? Anything I am missing? If you can spot anything wrong with the Xen code, do let me know. Otherwise, I am thinking of disabling the warning: Cheers, Stefano diff --git a/xen/Rules.mk b/xen/Rules.mk index 5337e20..8d5c77c 100644 --- a/xen/Rules.mk +++ b/xen/Rules.mk @@ -86,6 +86,9 @@ CFLAGS += $(CFLAGS-y) # allow extra CFLAGS externally via EXTRA_CFLAGS_XEN_CORE CFLAGS += $(EXTRA_CFLAGS_XEN_CORE) +# Disable GCC 9 warning about pointers to members of a packed struct +CFLAGS += -Wno-address-of-packed-member + # Most CFLAGS are safe for assembly files: # -std=gnu{89,99} gets confused by #-prefixed end-of-line comments # -flto makes no sense and annoys clang