diff options
Diffstat (limited to 'recipes-extended/ipxe/files/0003-build-Prevent-the-use-of-reserved-words-in-C23.patch')
-rw-r--r-- | recipes-extended/ipxe/files/0003-build-Prevent-the-use-of-reserved-words-in-C23.patch | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/recipes-extended/ipxe/files/0003-build-Prevent-the-use-of-reserved-words-in-C23.patch b/recipes-extended/ipxe/files/0003-build-Prevent-the-use-of-reserved-words-in-C23.patch new file mode 100644 index 00000000..fb93d96f --- /dev/null +++ b/recipes-extended/ipxe/files/0003-build-Prevent-the-use-of-reserved-words-in-C23.patch | |||
@@ -0,0 +1,103 @@ | |||
1 | From 2f39451dbab215763c09465848b89dcf41eb71be Mon Sep 17 00:00:00 2001 | ||
2 | From: Miao Wang <shankerwangmiao@gmail.com> | ||
3 | Date: Sun, 27 Apr 2025 17:30:49 +0100 | ||
4 | Subject: [PATCH] [build] Prevent the use of reserved words in C23 | ||
5 | |||
6 | GCC 15 defaults to C23, which reserves bool, true, and false as | ||
7 | keywords. Avoid using these as parameter or variable names. | ||
8 | |||
9 | Modified-by: Michael Brown <mcb30@ipxe.org> | ||
10 | Signed-off-by: Michael Brown <mcb30@ipxe.org> | ||
11 | Upstream-Status: Backport [https://github.com/ipxe/ipxe/pull/1457] | ||
12 | --- | ||
13 | .../infiniband/mlx_utils/src/public/mlx_pci_gw.c | 4 ++-- | ||
14 | src/drivers/net/igbvf/igbvf_osdep.h | 7 ++----- | ||
15 | src/interface/efi/efi_hii.c | 12 ++++++------ | ||
16 | 3 files changed, 10 insertions(+), 13 deletions(-) | ||
17 | |||
18 | diff --git a/src/drivers/infiniband/mlx_utils/src/public/mlx_pci_gw.c b/src/drivers/infiniband/mlx_utils/src/public/mlx_pci_gw.c | ||
19 | index 30c1e644e..0b257ed22 100644 | ||
20 | --- a/src/drivers/infiniband/mlx_utils/src/public/mlx_pci_gw.c | ||
21 | +++ b/src/drivers/infiniband/mlx_utils/src/public/mlx_pci_gw.c | ||
22 | @@ -32,7 +32,7 @@ mlx_status | ||
23 | mlx_pci_gw_check_capability_id( | ||
24 | IN mlx_utils *utils, | ||
25 | IN mlx_uint8 cap_pointer, | ||
26 | - OUT mlx_boolean *bool | ||
27 | + OUT mlx_boolean *result | ||
28 | ) | ||
29 | { | ||
30 | mlx_status status = MLX_SUCCESS; | ||
31 | @@ -41,7 +41,7 @@ mlx_pci_gw_check_capability_id( | ||
32 | status = mlx_pci_read(utils, MlxPciWidthUint8, offset, | ||
33 | 1, &id); | ||
34 | MLX_CHECK_STATUS(utils, status, read_err,"failed to read capability id"); | ||
35 | - *bool = ( id == PCI_GW_CAPABILITY_ID ); | ||
36 | + *result = ( id == PCI_GW_CAPABILITY_ID ); | ||
37 | read_err: | ||
38 | return status; | ||
39 | } | ||
40 | diff --git a/src/drivers/net/igbvf/igbvf_osdep.h b/src/drivers/net/igbvf/igbvf_osdep.h | ||
41 | index 8ac179de0..dc65da6c1 100644 | ||
42 | --- a/src/drivers/net/igbvf/igbvf_osdep.h | ||
43 | +++ b/src/drivers/net/igbvf/igbvf_osdep.h | ||
44 | @@ -35,8 +35,9 @@ FILE_LICENCE ( GPL2_ONLY ); | ||
45 | #ifndef _IGBVF_OSDEP_H_ | ||
46 | #define _IGBVF_OSDEP_H_ | ||
47 | |||
48 | +#include <stdbool.h> | ||
49 | + | ||
50 | #define u8 unsigned char | ||
51 | -#define bool boolean_t | ||
52 | #define dma_addr_t unsigned long | ||
53 | #define __le16 uint16_t | ||
54 | #define __le32 uint32_t | ||
55 | @@ -51,10 +52,6 @@ FILE_LICENCE ( GPL2_ONLY ); | ||
56 | #define ETH_FCS_LEN 4 | ||
57 | |||
58 | typedef int spinlock_t; | ||
59 | -typedef enum { | ||
60 | - false = 0, | ||
61 | - true = 1 | ||
62 | -} boolean_t; | ||
63 | |||
64 | #define usec_delay(x) udelay(x) | ||
65 | #define msec_delay(x) mdelay(x) | ||
66 | diff --git a/src/interface/efi/efi_hii.c b/src/interface/efi/efi_hii.c | ||
67 | index 506fc8869..66f58affe 100644 | ||
68 | --- a/src/interface/efi/efi_hii.c | ||
69 | +++ b/src/interface/efi/efi_hii.c | ||
70 | @@ -147,13 +147,13 @@ void efi_ifr_end_op ( struct efi_ifr_builder *ifr ) { | ||
71 | */ | ||
72 | void efi_ifr_false_op ( struct efi_ifr_builder *ifr ) { | ||
73 | size_t dispaddr = ifr->ops_len; | ||
74 | - EFI_IFR_FALSE *false; | ||
75 | + EFI_IFR_FALSE *op; | ||
76 | |||
77 | /* Add opcode */ | ||
78 | - false = efi_ifr_op ( ifr, EFI_IFR_FALSE_OP, sizeof ( *false ) ); | ||
79 | + op = efi_ifr_op ( ifr, EFI_IFR_FALSE_OP, sizeof ( *op ) ); | ||
80 | |||
81 | DBGC ( ifr, "IFR %p false\n", ifr ); | ||
82 | - DBGC2_HDA ( ifr, dispaddr, false, sizeof ( *false ) ); | ||
83 | + DBGC2_HDA ( ifr, dispaddr, op, sizeof ( *op ) ); | ||
84 | } | ||
85 | |||
86 | /** | ||
87 | @@ -462,13 +462,13 @@ void efi_ifr_text_op ( struct efi_ifr_builder *ifr, unsigned int prompt_id, | ||
88 | */ | ||
89 | void efi_ifr_true_op ( struct efi_ifr_builder *ifr ) { | ||
90 | size_t dispaddr = ifr->ops_len; | ||
91 | - EFI_IFR_TRUE *true; | ||
92 | + EFI_IFR_TRUE *op; | ||
93 | |||
94 | /* Add opcode */ | ||
95 | - true = efi_ifr_op ( ifr, EFI_IFR_TRUE_OP, sizeof ( *true ) ); | ||
96 | + op = efi_ifr_op ( ifr, EFI_IFR_TRUE_OP, sizeof ( *op ) ); | ||
97 | |||
98 | DBGC ( ifr, "IFR %p true\n", ifr ); | ||
99 | - DBGC2_HDA ( ifr, dispaddr, true, sizeof ( *true ) ); | ||
100 | + DBGC2_HDA ( ifr, dispaddr, op, sizeof ( *op ) ); | ||
101 | } | ||
102 | |||
103 | /** | ||