diff mbox series

hw/cxl: avoid build error with lower(<=9) gcc versions

Message ID 20231014120322.4145387-1-jtp.park@samsung.com
State New, archived
Headers show
Series hw/cxl: avoid build error with lower(<=9) gcc versions | expand

Commit Message

Jeongtae Park Oct. 14, 2023, 12:03 p.m. UTC
We are testing on the below branch[1] and getting the following build
error when using gcc-9 or gcc-7 (gcc-11 is ok).

I was reported in private to Jonathan Cameron, and he will get rid of
it soon.

This is just for your information and for keeping on list.

Thanks
/jtpark

[1]: https://gitlab.com/jic23/qemu/-/tree/cxl-2023-09-13/

Reported-by: Kyungsan Kim <ks0204.kim@samsung.com>
Signed-off-by: Jeongtae Park <jtp.park@samsung.com>
---
 hw/cxl/cxl-component-utils.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Comments

Jonathan Cameron Oct. 18, 2023, 4:37 p.m. UTC | #1
On Sat, 14 Oct 2023 21:03:22 +0900
Jeongtae Park <jtp.park@samsung.com> wrote:

> We are testing on the below branch[1] and getting the following build
> error when using gcc-9 or gcc-7 (gcc-11 is ok).
> 
> I was reported in private to Jonathan Cameron, and he will get rid of
> it soon.
> 
> This is just for your information and for keeping on list.
> 
> Thanks
> /jtpark
> 
> [1]: https://gitlab.com/jic23/qemu/-/tree/cxl-2023-09-13/
> 
> Reported-by: Kyungsan Kim <ks0204.kim@samsung.com>
> Signed-off-by: Jeongtae Park <jtp.park@samsung.com>
FWIW this affects CLANG as well. I have no idea why reducing the scope 
surrounding a _Static_assert() has the affect.  If anyone has any pointers
to why that would be great.  Same thing in a build issue report from Michael.

> ---
>  hw/cxl/cxl-component-utils.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/hw/cxl/cxl-component-utils.c b/hw/cxl/cxl-component-utils.c
> index c022a90774..fd15d9a61e 100644
> --- a/hw/cxl/cxl-component-utils.c
> +++ b/hw/cxl/cxl-component-utils.c
> @@ -325,9 +325,11 @@ void cxl_component_register_init_common(uint32_t *reg_state,
>      case CXL2_ROOT_PORT:
>      case CXL2_UPSTREAM_PORT:
>      case CXL2_DOWNSTREAM_PORT:
> -        init_cap_reg(RAS, 2, 2);
> -        ras_init_common(reg_state, write_msk);
> -        break;
> +        {
> +            init_cap_reg(RAS, 2, 2);
> +            ras_init_common(reg_state, write_msk);
> +            break;
> +        }
>      default:
>          break;
>      }
diff mbox series

Patch

diff --git a/hw/cxl/cxl-component-utils.c b/hw/cxl/cxl-component-utils.c
index c022a90774..fd15d9a61e 100644
--- a/hw/cxl/cxl-component-utils.c
+++ b/hw/cxl/cxl-component-utils.c
@@ -325,9 +325,11 @@  void cxl_component_register_init_common(uint32_t *reg_state,
     case CXL2_ROOT_PORT:
     case CXL2_UPSTREAM_PORT:
     case CXL2_DOWNSTREAM_PORT:
-        init_cap_reg(RAS, 2, 2);
-        ras_init_common(reg_state, write_msk);
-        break;
+        {
+            init_cap_reg(RAS, 2, 2);
+            ras_init_common(reg_state, write_msk);
+            break;
+        }
     default:
         break;
     }