From nobody Sun Nov 9 14:50:01 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1551433452081512.7001589020437; Fri, 1 Mar 2019 01:44:12 -0800 (PST) Received: from localhost ([127.0.0.1]:53564 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gzeiA-0005Tb-GN for importer@patchew.org; Fri, 01 Mar 2019 04:44:10 -0500 Received: from eggs.gnu.org ([209.51.188.92]:38028) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gzede-0001ky-5p for qemu-devel@nongnu.org; Fri, 01 Mar 2019 04:39:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gzedd-0004Fa-Aw for qemu-devel@nongnu.org; Fri, 01 Mar 2019 04:39:30 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:55468 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gzedd-0004Do-4d for qemu-devel@nongnu.org; Fri, 01 Mar 2019 04:39:29 -0500 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x219T2sM025385 for ; Fri, 1 Mar 2019 04:39:26 -0500 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 2qy15nbd69-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 01 Mar 2019 04:39:25 -0500 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 1 Mar 2019 09:39:24 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp03.uk.ibm.com (192.168.101.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 1 Mar 2019 09:39:20 -0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x219dKYu62783496 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 1 Mar 2019 09:39:20 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F0313AE051; Fri, 1 Mar 2019 09:39:19 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DD3CAAE04D; Fri, 1 Mar 2019 09:39:19 +0000 (GMT) Received: from smtp.lab.toulouse-stg.fr.ibm.com (unknown [9.101.4.1]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 1 Mar 2019 09:39:19 +0000 (GMT) Received: from bahia.lan (sig-9-145-41-217.uk.ibm.com [9.145.41.217]) by smtp.lab.toulouse-stg.fr.ibm.com (Postfix) with ESMTP id 2FE6C220246; Fri, 1 Mar 2019 10:39:19 +0100 (CET) From: Greg Kurz To: qemu-devel@nongnu.org Date: Fri, 01 Mar 2019 10:39:18 +0100 User-Agent: StGit/unknown-version MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-TM-AS-GCONF: 00 x-cbid: 19030109-0012-0000-0000-000002FBB1CC X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19030109-0013-0000-0000-00002133614E Message-Id: <155143315831.102868.17515265400523392682.stgit@bahia.lan> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-03-01_08:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=4 phishscore=0 bulkscore=0 spamscore=0 clxscore=1034 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=858 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1903010066 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by mx0a-001b2d01.pphosted.com id x219T2sM025385 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.158.5 Subject: [Qemu-devel] [PATCH v2] slirp: Fix build with gcc 9 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , samuel.thibault@ens-lyon.org, Greg Kurz , jan.kiszka@siemens.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Build fails with gcc 9: CC slirp/ndp_table.o slirp/ndp_table.c: In function =E2=80=98ndp_table_add=E2=80=99: slirp/ndp_table.c:31:23: error: taking address of packed member of =E2=80= =98struct ndpentry=E2=80=99 may result in an unaligned pointer value [-Werr= or=3Daddress-of-packed-member] 31 | if (in6_equal(&ndp_table->table[i].ip_addr, &ip_addr)) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ slirp/ndp_table.c: In function =E2=80=98ndp_table_search=E2=80=99: slirp/ndp_table.c:75:23: error: taking address of packed member of =E2=80= =98struct ndpentry=E2=80=99 may result in an unaligned pointer value [-Werr= or=3Daddress-of-packed-member] 75 | if (in6_equal(&ndp_table->table[i].ip_addr, &ip_addr)) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors The ndpentry structure isn't used to model on-the-wire data or anything else that would care for the struct layout. It doesn't need to be packed actually. Just drop SLIRP_PACKED. Signed-off-by: Greg Kurz Reviewed-by: Peter Maydell --- v2: - don't check the struct size at compile time --- slirp/slirp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slirp/slirp.h b/slirp/slirp.h index 752a4cd8c81c..8068ba1d1e9e 100644 --- a/slirp/slirp.h +++ b/slirp/slirp.h @@ -106,7 +106,7 @@ bool arp_table_search(Slirp *slirp, uint32_t ip_addr, struct ndpentry { unsigned char eth_addr[ETH_ALEN]; /* sender hardware address */ struct in6_addr ip_addr; /* sender IP address */ -} SLIRP_PACKED; +}; =20 #define NDP_TABLE_SIZE 16 =20