[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 2/4] compiler: drop ; after BUILD_BUG_ON
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH v2 2/4] compiler: drop ; after BUILD_BUG_ON |
Date: |
Thu, 19 Jan 2017 09:09:50 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) |
"Michael S. Tsirkin" <address@hidden> writes:
> All users include the trailing ;, let's require that
> so that uses such as if (a) QEMU_BUILD_BUG_ON(); do not
> produce unexpected results.
>
> Not a huge problem for QEMU since our style requires the use
> of {} but seems cleaner nevertheless.
I think the actual problem is that it sets a bad example.
> Signed-off-by: Michael S. Tsirkin <address@hidden>
> ---
> include/qemu/compiler.h | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h
> index 157698b..2882470 100644
> --- a/include/qemu/compiler.h
> +++ b/include/qemu/compiler.h
> @@ -86,7 +86,8 @@
> #define type_check(t1,t2) ((t1*)0 - (t2*)0)
>
> #define QEMU_BUILD_BUG_ON(x) \
> - typedef char glue(qemu_build_bug_on__,__LINE__)[(x)?-1:1]
> __attribute__((unused));
> + typedef char glue(qemu_build_bug_on__,__LINE__)[(x) ? -1 : 1] \
> + __attribute__((unused))
>
> #if defined __GNUC__
> # if !QEMU_GNUC_PREREQ(4, 4)
Preferably with the commit message clarified a bit:
Reviewed-by: Markus Armbruster <address@hidden>
[Qemu-devel] [PATCH v2 3/4] compiler: expression version of QEMU_BUILD_BUG_ON, Michael S. Tsirkin, 2017/01/18
- Re: [Qemu-devel] [PATCH v2 3/4] compiler: expression version of QEMU_BUILD_BUG_ON, Markus Armbruster, 2017/01/19
- Re: [Qemu-devel] [PATCH v2 3/4] compiler: expression version of QEMU_BUILD_BUG_ON, Paolo Bonzini, 2017/01/19
- Re: [Qemu-devel] [PATCH v2 3/4] compiler: expression version of QEMU_BUILD_BUG_ON, Markus Armbruster, 2017/01/19
- Re: [Qemu-devel] [PATCH v2 3/4] compiler: expression version of QEMU_BUILD_BUG_ON, Michael S. Tsirkin, 2017/01/19
- Re: [Qemu-devel] [PATCH v2 3/4] compiler: expression version of QEMU_BUILD_BUG_ON, Eric Blake, 2017/01/19
- Re: [Qemu-devel] [PATCH v2 3/4] compiler: expression version of QEMU_BUILD_BUG_ON, Michael S. Tsirkin, 2017/01/19
- Re: [Qemu-devel] [PATCH v2 3/4] compiler: expression version of QEMU_BUILD_BUG_ON, Markus Armbruster, 2017/01/20
- Re: [Qemu-devel] [PATCH v2 3/4] compiler: expression version of QEMU_BUILD_BUG_ON, Michael S. Tsirkin, 2017/01/20
Re: [Qemu-devel] [PATCH v2 3/4] compiler: expression version of QEMU_BUILD_BUG_ON, Michael S. Tsirkin, 2017/01/19