[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 5/8] tcg: Remove stray semi-colons from target-*
From: |
Stefan Weil |
Subject: |
Re: [Qemu-devel] [PATCH 5/8] tcg: Remove stray semi-colons from target-*/helper.h |
Date: |
Sun, 15 Sep 2013 09:03:18 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130803 Thunderbird/17.0.8 |
Am 15.09.2013 02:03, schrieb Richard Henderson:
> During GEN_HELPER=1, these are actually stray top-level semi-colons
> which are technically invalid ISO C, but GCC accepts as an extension.
> If we added enough __extension__ markers that we could dare use
> -Wpedantic, we'd see
>
> warning: ISO C does not allow extra ‘;’ outside of a function
>
> This will become a hard error in the next patch, wherein those ; will
> appear in the middle of a data structure.
>
> Signed-off-by: Richard Henderson <address@hidden>
> ---
Instead of removing the semicolons from the DEF_HELPER_x lines,
I'd prefer removing them from the DEF_HELPER_FLAGS_x definitions.
Code formatters and static code analyzers (maybe humans, too) prefer
lines which look like valid C syntax, therefore
DEF_HELPER_FLAGS_1(ctpop, TCG_CALL_NO_RWG_SE, i64, i64);
is better for such tools than
DEF_HELPER_FLAGS_1(ctpop, TCG_CALL_NO_RWG_SE, i64, i64)
The compiler will also complain if someone adds a new DEF_HELPER_FLAGS_x
without semicolon in the first case, but it won't complain if someone adds
it with semicolon in the second case.
Regards,
Stefan
- [Qemu-devel] [PATCH 0/8] tcg: Tidy helpers registration, Richard Henderson, 2013/09/14
- [Qemu-devel] [PATCH 1/8] tcg: Delete tcg_helper_get_name declaration, Richard Henderson, 2013/09/14
- [Qemu-devel] [PATCH 2/8] tcg: Use a GHashTable for tcg_find_helper, Richard Henderson, 2013/09/14
- [Qemu-devel] [PATCH 3/8] target-m68k: Rename helpers.h to helper.h, Richard Henderson, 2013/09/14
- [Qemu-devel] [PATCH 4/8] tcg: Move helper registration into tcg_context_init, Richard Henderson, 2013/09/14
- [Qemu-devel] [PATCH 5/8] tcg: Remove stray semi-colons from target-*/helper.h, Richard Henderson, 2013/09/14
- Re: [Qemu-devel] [PATCH 5/8] tcg: Remove stray semi-colons from target-*/helper.h,
Stefan Weil <=
- [Qemu-devel] [PATCH 6/8] tcg: Put target helper data into an array., Richard Henderson, 2013/09/14
- [Qemu-devel] [PATCH 7/8] tcg: Add tcg-runtime.c helpers to all_helpers, Richard Henderson, 2013/09/14
- [Qemu-devel] [PATCH 8/8] tcg: Merge tcg_register_helper into tcg_context_init, Richard Henderson, 2013/09/14