From nobody Fri Apr 19 04:20:13 2024 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VLLzB3Gfcz5HmKx for ; Fri, 19 Apr 2024 04:20:22 +0000 (UTC) (envelope-from weh@microsoft.com) Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2070f.outbound.protection.outlook.com [IPv6:2a01:111:f400:feab::70f]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "DigiCert Cloud Services CA-1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VLLz963DWz4FmQ for ; Fri, 19 Apr 2024 04:20:21 +0000 (UTC) (envelope-from weh@microsoft.com) Authentication-Results: mx1.freebsd.org; none ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ebUHEk8UNoyqtvXoCjZ0Rp6SZo3ChUuC/Ful5Ccc4CpMHMZDxEKOviS1DKKFfiz6Tl5pgJ1hC2EJ2XoINpepFBI9DxLpaZGVicN3kRRkKfOb81KR1azuIjuEQaK23afgzsEVwFjYqn79jkVBmzHWhvnKskjtXRkOjpWfliFAHUG/E9hocLJAWUrOt4UuG7ggDzJLXcZ2YjmMDVPkJ+jRKMLfctTrO0kzn2ADKz0IRu9b657+nLMju5y+n7VNcjM9m/ON2W6ApXsI73xR90M2sJGVTbLNEXFIFwGdMf41D6Q1zRktx0nWXhgmOWfUXv2fkOkAblkoik+Tl9jnNcrGbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=NShcA1V2HV3epTS6o8lL4kLKbRNw+R5RpTK7qjXYbhA=; b=KPGRVDR4WzeP8vSft1YMHxcegxqQR3SJ/J6AvXXDhdzsXhS+QrClyrFgX6cK5e4f3H8K2ZVUYXfFEJP7lb4XRJ+Sln/6JfcBUO3ByGLFOxIPmu90hvB01+0I3KzTYpEd0EdOYaaxmBBT578BYvz/qCLPF9rheNa7yQgouzutxAbRRIS0aOvnPR/P9Nsq5sNVBEBInDK/w55FQUrC5oHFDbpHZ+9PneqPD4cd5sm42wbL2tPLHNPa5hwp615m/P4kbUJc1N923hQVExP2hMnLUNiHOvz222mZ8RKQY1BYCnxp/HJDFN2CBdA+DZYoBU9JVT25RCi8PUuMFrTg/uQZcg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NShcA1V2HV3epTS6o8lL4kLKbRNw+R5RpTK7qjXYbhA=; b=Acn6SlJ1g/NaRga9gob/PIwRviKiuOe9/FcI/tE0F0j6V1YWnXqNrNN57koA4ouC6KnVo14WILSBkZfWV4k5+gYn4/6YzxJwcDlTokvo1YScwsFLZf4pxh6vNnCLAfj+0Q/lQB8mCWhWKv6OgpuVZeUO15LRCx+oP/CY5Quual8= Received: from TYZP153MB0399.APCP153.PROD.OUTLOOK.COM (2603:1096:400:21::12) by TYZP153MB0399.APCP153.PROD.OUTLOOK.COM (2603:1096:400:21::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.12; Fri, 19 Apr 2024 04:20:14 +0000 Received: from TYZP153MB0399.APCP153.PROD.OUTLOOK.COM ([fe80::788:1883:1f09:480e]) by TYZP153MB0399.APCP153.PROD.OUTLOOK.COM ([fe80::788:1883:1f09:480e%7]) with mapi id 15.20.7519.010; Fri, 19 Apr 2024 04:20:14 +0000 From: Wei Hu To: Konstantin Belousov CC: Warner Losh , "freebsd-hackers@FreeBSD.org" Subject: RE: How to add a -W flag in local Makefile Thread-Topic: How to add a -W flag in local Makefile Thread-Index: AdqRkOe7luhT44chS0qlVqfwwelwwgADmX2AAAFW5NAABUv9AAAVW9Dg Date: Fri, 19 Apr 2024 04:20:13 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=20511b01-d971-4d38-8cb9-1a0461ab90ae;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=true;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Standard;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=Internal;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2024-04-19T04:08:49Z;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: TYZP153MB0399:EE_ x-ms-office365-filtering-correlation-id: d3e01d49-c83a-4f73-90a2-08dc60280290 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230031|1800799015|376005|366007|38070700009; x-microsoft-antispam-message-info: =?us-ascii?Q?qrJxUMCBTIiki46j/9A9qzt0q5+Rz9ojSWQpZkLS441aOiMNg2ilBJKbBnFl?= =?us-ascii?Q?W10FQae4E2MJQ3D6kklqpAGwke4u2Idc82hGnaDuqAmOQCKpinWlBLUAKcHM?= =?us-ascii?Q?lCTMjMhTytez5shj/jczXuo+yEGc8Y9uwe9RsOlyXVgBg7AzGKBm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XETMRxtxa3Eq5QA4QgNbJRsUM5+Ki9pH9dSw?= =?us-ascii?Q?1Pf8nXVsAheyYdDOe4qpo5GPCY7NMZBl2GsG5WogATchvIcLHUeUdc0gbFw/?= =?us-ascii?Q?d/u8zWzZazB+M8afLncz7qVpoGXmQPM8eAuUWEN6Xh1BnuI5HA4X5h2KFLg/?= =?us-ascii?Q?blwCANqeLR6FOpisAtkUJEOaL0WwmI1FGCGcNl9PgujDm3qLF5uAhto3qnMA?= =?us-ascii?Q?1CcWf6H+uFqmiR+SufFciyAgm8u68FgOyoaENn+5kNYvzFysO5pzJLOUy0Gw?= =?us-ascii?Q?10r0ZH6xS6D7KN0RFGdbLnaStjxX6Sgciatrm8RWWR2m2g=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYZP153MB0399.APCP153.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230031)(1800799015)(376005)(366007)(38070700009);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?m0+MKk+MCoMqHY/1blwSEtsh460NNi2WTDYo3yfq1xhLsKTXxsdypOKJx06v?= =?us-ascii?Q?T9APJtNfJgfRxF50S+farIiPgGXB176mXbp2C5m34bwubl8jbv0vXK4marlZ?= =?us-ascii?Q?9Y0A9jUDkwkjJYmJmX1z41aXAeQrrU5NKYATt7rOuZkVRwmNKCz6tKvIsrsL?= =?us-ascii?Q?wYsLEbPW7dKUOHOl8Bhqu2dsAyfeYRab9+EYem2aCWtmH5DdNc0L0lqVrAcu?= =?us-ascii?Q?5KS/nHyqY9v1NT1T+JQWwUEB53cUtEMxhfwwPQXhWLxs0EuiEuiWTMZz9m2V?= =?us-ascii?Q?X1ODIEQwNaOW3Lw6WmvORCQn+ZCGFHXJTMW1e8k2ScmDC70u+w69MUL3LIci?= =?us-ascii?Q?h6vyJscn7xzxbPz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wr?= =?us-ascii?Q?8KXVC5VYeHh28HzlawXp8JESb5ihX3MIvoGLusti06dbl6ryNV624SM4yPsx?= =?us-ascii?Q?v/fR1fSBjhnbkPMpMWBQGYNnTQL1yjkHoidNkTAaEElmVTzccvnwoGk/GSkZ?= =?us-ascii?Q?gdt8NN4BcFLYEKMVWmdDaRYS8KPLdFpaqpCwBZJ2AFUaB6fVpYWJkN4i/NNj?= =?us-ascii?Q?IDOtSmbASfqHi+uL6X//tv+75jhc/XSI1llxm9HqeVBpOiEuYURlkuAIe8sg?= =?us-ascii?Q?k6y4vSfbsfnUdFJv4MCy0eWJH7e+5BiLrnTMROcJ1oldQHUIYkqVyBVcOAEd?= =?us-ascii?Q?qlXI4NW08EEzmd17fv2BZNY3Ba4lWoqea5hNjT7tICjyzCwMMP1T2/wczbwI?= =?us-ascii?Q?RbTKMra3+6GzOzZ5UtaIXKw=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: TYZP153MB0399.APCP153.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: d3e01d49-c83a-4f73-90a2-08dc60280290 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Apr 2024 04:20:13.7365 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: dtrDmcnvk0q86ZErH7YdtbK8tMtxj97R2D131RlM62n/QCwi5LkfHoaZrmDreggpSB6gtNPj0EbWorNLTXyFFw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZP153MB0399 X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:8075, ipnet:2a01:111:f000::/36, country:US] X-Rspamd-Queue-Id: 4VLLz963DWz4FmQ > -----Original Message----- > From: Konstantin Belousov > Sent: Friday, April 19, 2024 1:57 AM > To: Wei Hu > Cc: Warner Losh ; freebsd-hackers@FreeBSD.org > Subject: Re: How to add a -W flag in local Makefile >=20 > On Thu, Apr 18, 2024 at 03:27:13PM +0000, Wei Hu wrote: > > I added something like: > > > > diff --git a/sys/dev/hyperv/vmbus/vmbus_var.h > > b/sys/dev/hyperv/vmbus/vmbus_var.h > > index b598f782947e..6e3b7b040827 100644 > > --- a/sys/dev/hyperv/vmbus/vmbus_var.h > > +++ b/sys/dev/hyperv/vmbus/vmbus_var.h > > @@ -193,4 +193,17 @@ struct hyperv_tlb_flush { > > uint64_t hv_vm_tlb_flush(pmap_t pmap, vm_offset_t addr1, > > vm_offset_t addr2, cpuset_t mask); > > > > +struct hv_vpset { > > + uint64_t format; > > + uint64_t valid_bank_mask; > > + uint64_t bank_contents[]; > > +} __packed; > > + > > +struct hv_tlb_flush_ex { > > + uint64_t address_space; > > + uint64_t flags; > > + struct hv_vpset hv_vp_set; > > + uint64_t gva_list[]; > > +} __packed; > > + > > #endif /* !_VMBUS_VAR_H_ */ > > > > So, the struct hv_vpset is the second last member of struct hv_tlb_flus= h_ex. > The member bank_contents[] in struct hv_vpset is of variable length. This > would makes the last two members of struct hv_tlb_flush_ex both variable > length. Therefore, the flag '-Wno-gnu-variable-sized-type-not-at-end' is > needed, otherwise it would complain about this with errors like: > > > No, the compiler' complain is correct. The structure definition for > hv_tlb_flush_ex does not make sense: you never can access gva_list (excep= t for > the case of bank_contents being zero-sized). The same code already exists in Linux and Windows. Linux also added a compi= ling flag to suppress similar warnings.=20 Anyway, the purpose of this email is to understand how to add such flags in= local Makefiles and make it effective for global buildkernel. Adding such flags in local Makefiles already proves to be working when only building under lo= cal=20 directory. Thanks, Wei