]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[build] Prevent the use of reserved words in C23
authorMiao Wang <shankerwangmiao@gmail.com>
Sun, 27 Apr 2025 16:30:49 +0000 (17:30 +0100)
committerMichael Brown <mcb30@ipxe.org>
Sun, 27 Apr 2025 17:40:33 +0000 (18:40 +0100)
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>
src/drivers/infiniband/mlx_utils/src/public/mlx_pci_gw.c
src/drivers/net/igbvf/igbvf_osdep.h
src/interface/efi/efi_hii.c

index 30c1e644ee142d9999afc043d1b65f89cfb900b7..0b257ed22b7684e683cd3502cc63e6ab1acd4d05 100644 (file)
@@ -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;
 }
index 8ac179de0245d43f410ee247adcc3e35d7f7f92d..dc65da6c1cb489dec62a91ac9496de4f03ae5a31 100644 (file)
@@ -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)
index 506fc886995ca6bac697e28fc68e4953765882fe..66f58affe7b91d88e1ac72de7db48a3b1ea665eb 100644 (file)
@@ -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 ) );
 }
 
 /**