diff mbox series

[kvm-unit-tests] s390x: fix build with clang

Message ID 20220726083725.32454-1-pbonzini@redhat.com (mailing list archive)
State New, archived
Headers show
Series [kvm-unit-tests] s390x: fix build with clang | expand

Commit Message

Paolo Bonzini July 26, 2022, 8:37 a.m. UTC
Reported by Travis CI:

/home/travis/build/kvm-unit-tests/kvm-unit-tests/lib/s390x/fault.c:43:56: error: static_assert with no message is a C++17 extension [-Werror,-Wc++17-extensions]
                _Static_assert(ARRAY_SIZE(prot_str) == PROT_NUM_CODES);
                                                                     ^
                                                                     , ""
1 error generated.
make: *** [<builtin>: lib/s390x/fault.o] Error 1

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 lib/s390x/fault.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Thomas Huth July 26, 2022, 8:39 a.m. UTC | #1
On 26/07/2022 10.37, Paolo Bonzini wrote:
> Reported by Travis CI:
> 
> /home/travis/build/kvm-unit-tests/kvm-unit-tests/lib/s390x/fault.c:43:56: error: static_assert with no message is a C++17 extension [-Werror,-Wc++17-extensions]
>                  _Static_assert(ARRAY_SIZE(prot_str) == PROT_NUM_CODES);
>                                                                       ^
>                                                                       , ""
> 1 error generated.
> make: *** [<builtin>: lib/s390x/fault.o] Error 1
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>   lib/s390x/fault.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/s390x/fault.c b/lib/s390x/fault.c
> index 1cd6e26..a882d5d 100644
> --- a/lib/s390x/fault.c
> +++ b/lib/s390x/fault.c
> @@ -40,7 +40,7 @@ static void print_decode_pgm_prot(union teid teid)
>   			"LAP",
>   			"IEP",
>   		};
> -		_Static_assert(ARRAY_SIZE(prot_str) == PROT_NUM_CODES);
> +		_Static_assert(ARRAY_SIZE(prot_str) == PROT_NUM_CODES, "ESOP2 prot codes");
>   		int prot_code = teid_esop2_prot_code(teid);
>   
>   		printf("Type: %s\n", prot_str[prot_code]);

Reviewed-by: Thomas Huth <thuth@redhat.com>
Claudio Imbrenda July 28, 2022, 1:06 p.m. UTC | #2
On Tue, 26 Jul 2022 10:37:25 +0200
Paolo Bonzini <pbonzini@redhat.com> wrote:

> Reported by Travis CI:
> 
> /home/travis/build/kvm-unit-tests/kvm-unit-tests/lib/s390x/fault.c:43:56: error: static_assert with no message is a C++17 extension [-Werror,-Wc++17-extensions]
>                 _Static_assert(ARRAY_SIZE(prot_str) == PROT_NUM_CODES);
>                                                                      ^
>                                                                      , ""
> 1 error generated.
> make: *** [<builtin>: lib/s390x/fault.o] Error 1
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>

> ---
>  lib/s390x/fault.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/s390x/fault.c b/lib/s390x/fault.c
> index 1cd6e26..a882d5d 100644
> --- a/lib/s390x/fault.c
> +++ b/lib/s390x/fault.c
> @@ -40,7 +40,7 @@ static void print_decode_pgm_prot(union teid teid)
>  			"LAP",
>  			"IEP",
>  		};
> -		_Static_assert(ARRAY_SIZE(prot_str) == PROT_NUM_CODES);
> +		_Static_assert(ARRAY_SIZE(prot_str) == PROT_NUM_CODES, "ESOP2 prot codes");
>  		int prot_code = teid_esop2_prot_code(teid);
>  
>  		printf("Type: %s\n", prot_str[prot_code]);
diff mbox series

Patch

diff --git a/lib/s390x/fault.c b/lib/s390x/fault.c
index 1cd6e26..a882d5d 100644
--- a/lib/s390x/fault.c
+++ b/lib/s390x/fault.c
@@ -40,7 +40,7 @@  static void print_decode_pgm_prot(union teid teid)
 			"LAP",
 			"IEP",
 		};
-		_Static_assert(ARRAY_SIZE(prot_str) == PROT_NUM_CODES);
+		_Static_assert(ARRAY_SIZE(prot_str) == PROT_NUM_CODES, "ESOP2 prot codes");
 		int prot_code = teid_esop2_prot_code(teid);
 
 		printf("Type: %s\n", prot_str[prot_code]);