summaryrefslogtreecommitdiffstats
path: root/recipes-extended/ipxe/files/0003-build-Prevent-the-use-of-reserved-words-in-C23.patch
blob: fb93d96ff9a5d65ce73eb34e68710fe8b855e994 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
From 2f39451dbab215763c09465848b89dcf41eb71be Mon Sep 17 00:00:00 2001
From: Miao Wang <shankerwangmiao@gmail.com>
Date: Sun, 27 Apr 2025 17:30:49 +0100
Subject: [PATCH] [build] Prevent the use of reserved words in C23

GCC 15 defaults to C23, which reserves bool, true, and false as
keywords.  Avoid using these as parameter or variable names.

Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Upstream-Status: Backport [https://github.com/ipxe/ipxe/pull/1457]
---
 .../infiniband/mlx_utils/src/public/mlx_pci_gw.c     |  4 ++--
 src/drivers/net/igbvf/igbvf_osdep.h                  |  7 ++-----
 src/interface/efi/efi_hii.c                          | 12 ++++++------
 3 files changed, 10 insertions(+), 13 deletions(-)

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
index 30c1e644e..0b257ed22 100644
--- a/src/drivers/infiniband/mlx_utils/src/public/mlx_pci_gw.c
+++ b/src/drivers/infiniband/mlx_utils/src/public/mlx_pci_gw.c
@@ -32,7 +32,7 @@ mlx_status
 mlx_pci_gw_check_capability_id(
 							IN mlx_utils *utils,
 							IN mlx_uint8 cap_pointer,
-							OUT mlx_boolean *bool
+							OUT mlx_boolean *result
 							)
 {
 	mlx_status 		status = MLX_SUCCESS;
@@ -41,7 +41,7 @@ mlx_pci_gw_check_capability_id(
 	status = mlx_pci_read(utils, MlxPciWidthUint8, offset,
 				1, &id);
 	MLX_CHECK_STATUS(utils, status, read_err,"failed to read capability id");
-	*bool = ( id == PCI_GW_CAPABILITY_ID );
+	*result = ( id == PCI_GW_CAPABILITY_ID );
 read_err:
 	return status;
 }
diff --git a/src/drivers/net/igbvf/igbvf_osdep.h b/src/drivers/net/igbvf/igbvf_osdep.h
index 8ac179de0..dc65da6c1 100644
--- a/src/drivers/net/igbvf/igbvf_osdep.h
+++ b/src/drivers/net/igbvf/igbvf_osdep.h
@@ -35,8 +35,9 @@ FILE_LICENCE ( GPL2_ONLY );
 #ifndef _IGBVF_OSDEP_H_
 #define _IGBVF_OSDEP_H_
 
+#include <stdbool.h>
+
 #define u8         unsigned char
-#define bool       boolean_t
 #define dma_addr_t unsigned long
 #define __le16     uint16_t
 #define __le32     uint32_t
@@ -51,10 +52,6 @@ FILE_LICENCE ( GPL2_ONLY );
 #define ETH_FCS_LEN 4
 
 typedef int spinlock_t;
-typedef enum {
-    false = 0,
-    true = 1
-} boolean_t;
 
 #define usec_delay(x) udelay(x)
 #define msec_delay(x) mdelay(x)
diff --git a/src/interface/efi/efi_hii.c b/src/interface/efi/efi_hii.c
index 506fc8869..66f58affe 100644
--- a/src/interface/efi/efi_hii.c
+++ b/src/interface/efi/efi_hii.c
@@ -147,13 +147,13 @@ void efi_ifr_end_op ( struct efi_ifr_builder *ifr ) {
  */
 void efi_ifr_false_op ( struct efi_ifr_builder *ifr ) {
 	size_t dispaddr = ifr->ops_len;
-	EFI_IFR_FALSE *false;
+	EFI_IFR_FALSE *op;
 
 	/* Add opcode */
-	false = efi_ifr_op ( ifr, EFI_IFR_FALSE_OP, sizeof ( *false ) );
+	op = efi_ifr_op ( ifr, EFI_IFR_FALSE_OP, sizeof ( *op ) );
 
 	DBGC ( ifr, "IFR %p false\n", ifr );
-	DBGC2_HDA ( ifr, dispaddr, false, sizeof ( *false ) );
+	DBGC2_HDA ( ifr, dispaddr, op, sizeof ( *op ) );
 }
 
 /**
@@ -462,13 +462,13 @@ void efi_ifr_text_op ( struct efi_ifr_builder *ifr, unsigned int prompt_id,
  */
 void efi_ifr_true_op ( struct efi_ifr_builder *ifr ) {
 	size_t dispaddr = ifr->ops_len;
-	EFI_IFR_TRUE *true;
+	EFI_IFR_TRUE *op;
 
 	/* Add opcode */
-	true = efi_ifr_op ( ifr, EFI_IFR_TRUE_OP, sizeof ( *true ) );
+	op = efi_ifr_op ( ifr, EFI_IFR_TRUE_OP, sizeof ( *op ) );
 
 	DBGC ( ifr, "IFR %p true\n", ifr );
-	DBGC2_HDA ( ifr, dispaddr, true, sizeof ( *true ) );
+	DBGC2_HDA ( ifr, dispaddr, op, sizeof ( *op ) );
 }
 
 /**