From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: redhat.com, ip: 209.132.183.28, mailfrom: lersek@redhat.com) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by groups.io with SMTP; Wed, 18 Sep 2019 01:41:56 -0700 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 84A6A3175282; Wed, 18 Sep 2019 08:41:55 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-2.rdu2.redhat.com [10.10.120.2]) by smtp.corp.redhat.com (Postfix) with ESMTP id E84A560C05; Wed, 18 Sep 2019 08:41:47 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH 01/35] DO NOT APPLY: edk2: turn standard handle types into pointers to non-VOID To: Andrew Fish , "Ni, Ray" Cc: "devel@edk2.groups.io" , Achin Gupta , Anthony Perard , Ard Biesheuvel , "You, Benjamin" , "Zhang, Chao B" , "Bi, Dandan" , David Woodhouse , "Dong, Eric" , "Dong, Guo" , "Wu, Hao A" , "Carsey, Jaben" , "Wang, Jian J" , "Wu, Jiaxin" , "Yao, Jiewen" , Jordan Justen , Julien Grall , Leif Lindholm , "Gao, Liming" , "Ma, Maurice" , Mike Kinney , "Fu, Siyuan" , Supreeth Venkatesh , "Gao, Zhichao" References: <20190917194935.24322-1-lersek@redhat.com> <20190917194935.24322-2-lersek@redhat.com> <734D49CCEBEEF84792F5B80ED585239D5C2E3BE1@SHSMSX104.ccr.corp.intel.com> <1FFFA19B-454C-4B46-9DD0-339BB8011838@apple.com> From: "Laszlo Ersek" Message-ID: Date: Wed, 18 Sep 2019 10:41:46 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <1FFFA19B-454C-4B46-9DD0-339BB8011838@apple.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Wed, 18 Sep 2019 08:41:55 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 09/17/19 22:22, Andrew Fish wrote: > > >> On Sep 17, 2019, at 1:06 PM, Ni, Ray wrote: >> >> Laszlo, >> Thank you very much for this work. >> They are quite helpful to detect potential issues. >> >> But without this specific patch being checked in, future break will still happen. >> I don't want it to be checked in ASAP because I know that there are quite a lot of close source code that may get build break due to this change. >> Besides that, what prevent you make the decision to check in the changes? >> > > Ray, > > I was thinking the same thing. Could we make this an optional feature via a #define? We could always default to the Spec Behavior, and new projects could opt into the stricter version. > > #ifndef STRICTER_UEFI_TYPES > typedef VOID *EFI_PEI_FV_HANDLE; > #else > struct EFI_PEI_FV_OBJECT; > typedef struct EFI_PEI_FV_OBJECT *EFI_PEI_FV_HANDLE; > #endif Technically, this would work well. However, if we wanted to allow new projects to #define STRICTER_UEFI_TYPES as their normal mode of operation (and not just for a sanity check in CI), then we'd have to update the UEFI spec too. Otherwise, code that is technically spec-conformant (albeit semantically nonsensical), like I mentioned up-thread, would no longer compile: EFI_HANDLE Foobar; UINT64 Val; Foobar = &Val; Thanks Laszlo