Skip to contentSkip to conversation

hw/arm/aspeed: Fix build issue with clang 3.4

PATCH Applied Thomas Huth 3 participants 3 messages Nov 28, 2018 Arm/Aspeed machine support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/arm/aspeed: Fix build issue with clang 3.4

When using clang 3.4.2, compilation of QEMU fails like this:

CC aarch64-softmmu/hw/arm/aspeed.o
hw/arm/aspeed.c:36:3: error: redefinition of typedef 'AspeedBoardState' is a C11
feature [-Werror,-Wtypedef-redefinition]
} AspeedBoardState;
^
include/hw/arm/aspeed.h:14:33: note: previous definition is here

typedef struct AspeedBoardState AspeedBoardState;
                                ^

1 error generated.
make[1]: *** [hw/arm/aspeed.o] Error 1
make: *** [subdir-aarch64-softmmu] Error 2

Remove the duplicated typedef to fix this issue.

---
 hw/arm/aspeed.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
hw/arm/aspeed.c +2 -2
index 6b33ecd..5158985 100644
@@ -29,11 +29,11 @@ static struct arm_boot_info aspeed_board_binfo = {
     .nb_cpus = 1,
 };
 
-typedef struct AspeedBoardState {
+struct AspeedBoardState {
     AspeedSoCState soc;
     MemoryRegion ram;
     MemoryRegion max_ram;
-} AspeedBoardState;
+};
 
 /* Palmetto hardware value: 0x120CE416 */
 #define PALMETTO_BMC_HW_STRAP1 (                                        \
Signature · 1 line
1.8.3.1
Reviewed-by on v1 1/1
#1 lore raw

Hello Thomas,

Quoted 10 lines · Thomas Huth

When using clang 3.4.2, compilation of QEMU fails like this:

CC aarch64-softmmu/hw/arm/aspeed.o
hw/arm/aspeed.c:36:3: error: redefinition of typedef 'AspeedBoardState' is a C11
feature [-Werror,-Wtypedef-redefinition]
} AspeedBoardState;
^
include/hw/arm/aspeed.h:14:33: note: previous definition is here

typedef struct AspeedBoardState AspeedBoardState;
                                ^
Quoted 7 lines

1 error generated.
make[1]: *** [hw/arm/aspeed.o] Error 1
make: *** [subdir-aarch64-softmmu] Error 2

Remove the duplicated typedef to fix this issue.

yes. May be for 3.1.

Thanks,

C.

Quoted 23 lines
---
 hw/arm/aspeed.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
hw/arm/aspeed.c +2 -2
index 6b33ecd..5158985 100644
@@ -29,11 +29,11 @@ static struct arm_boot_info aspeed_board_binfo = {
     .nb_cpus = 1,
 };
 
-typedef struct AspeedBoardState {
+struct AspeedBoardState {
     AspeedSoCState soc;
     MemoryRegion ram;
     MemoryRegion max_ram;
-} AspeedBoardState;
+};
 
 /* Palmetto hardware value: 0x120CE416 */
 #define PALMETTO_BMC_HW_STRAP1 (                                        \
#2 lore raw
In reply to Thomas Huth
Quoted 11 lines · Thomas Huth

When using clang 3.4.2, compilation of QEMU fails like this:

CC aarch64-softmmu/hw/arm/aspeed.o
hw/arm/aspeed.c:36:3: error: redefinition of typedef 'AspeedBoardState' is a C11
feature [-Werror,-Wtypedef-redefinition]
} AspeedBoardState;
^
include/hw/arm/aspeed.h:14:33: note: previous definition is here

typedef struct AspeedBoardState AspeedBoardState;
                                ^
Quoted 7 lines

1 error generated.
make[1]: *** [hw/arm/aspeed.o] Error 1
make: *** [subdir-aarch64-softmmu] Error 2

Remove the duplicated typedef to fix this issue.

Applied, thanks.

-- PMM