Re: [PATCH] efi: Change grub_efi_boolean_t from char to enum

2023-09-04 Thread Glenn Washburn
On Sat, 2 Sep 2023 20:45:34 +0200 Daniel Kiper wrote: > On Thu, Aug 31, 2023 at 11:58:42PM -0500, Glenn Washburn wrote: > > On Thu, 31 Aug 2023 20:05:37 +0200 > > Daniel Kiper wrote: > > > > > On Mon, Aug 14, 2023 at 04:38:40PM -0500, Glenn Washburn wrote: > > > > This allows using GRUB_EFI_TRUE

Re: [PATCH] efi: Change grub_efi_boolean_t from char to enum

2023-09-04 Thread Glenn Washburn
On Thu, 31 Aug 2023 20:36:43 +0200 "Vladimir 'phcoder' Serbinenko" wrote: > I see little value in using enum here and too much compiler variance about > how it's handled. Are you specifically talking about GCC, or the diversity of compilers that GRUB might be compiled with? > Compiler is prett

Re: [PATCH] efi: Change grub_efi_boolean_t from char to enum

2023-09-02 Thread Daniel Kiper
On Thu, Aug 31, 2023 at 11:58:42PM -0500, Glenn Washburn wrote: > On Thu, 31 Aug 2023 20:05:37 +0200 > Daniel Kiper wrote: > > > On Mon, Aug 14, 2023 at 04:38:40PM -0500, Glenn Washburn wrote: > > > This allows using GRUB_EFI_TRUE and GRUB_EFI_FALSE with proper type and > > > value checking. The U

Re: [PATCH] efi: Change grub_efi_boolean_t from char to enum

2023-08-31 Thread Glenn Washburn
On Thu, 31 Aug 2023 20:05:37 +0200 Daniel Kiper wrote: > On Mon, Aug 14, 2023 at 04:38:40PM -0500, Glenn Washburn wrote: > > This allows using GRUB_EFI_TRUE and GRUB_EFI_FALSE with proper type and > > value checking. The UEFI 2.10 specification, in section 2.3.1, table 2.3, > > says the size of t

Re: [PATCH] efi: Change grub_efi_boolean_t from char to enum

2023-08-31 Thread Vladimir 'phcoder' Serbinenko
I see little value in using enum here and too much compiler variance about how it's handled. Compiler is pretty much allowed to choose any type for enum. If we go this route at all we should at very least do a compile time assert. Ideally I would keep it as-is. C unlike C++ does nothing to enforce

Re: [PATCH] efi: Change grub_efi_boolean_t from char to enum

2023-08-31 Thread Daniel Kiper
On Mon, Aug 14, 2023 at 04:38:40PM -0500, Glenn Washburn wrote: > This allows using GRUB_EFI_TRUE and GRUB_EFI_FALSE with proper type and > value checking. The UEFI 2.10 specification, in section 2.3.1, table 2.3, > says the size of the boolean is 1 byte and may only contain the values 0 or > 1. In

[PATCH] efi: Change grub_efi_boolean_t from char to enum

2023-08-14 Thread Glenn Washburn
This allows using GRUB_EFI_TRUE and GRUB_EFI_FALSE with proper type and value checking. The UEFI 2.10 specification, in section 2.3.1, table 2.3, says the size of the boolean is 1 byte and may only contain the values 0 or 1. In order to have the enum be 1-byte in size instead of the default int-siz