qemu-devel
[Top][All Lists]
Advanced

[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: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH 5/8] tcg: Remove stray semi-colons from target-*/helper.h
Date: Sun, 15 Sep 2013 11:44:01 +0100

On 15 September 2013 08:03, Stefan Weil <address@hidden> wrote:
> 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)

I agree it looks nicer, but for this kind of multipurpose macro definition
where one of the redefinitions is used for things like creating a
data structure (eg Richard's patch 6/8 in this series) it just doesn't
work, because the required separator for entries in an array is a comma,
not a semicolon.

It's just an unavoidable cost of doing this with the preprocessor
rather than (say) a custom little language which we parsed with
a python or perl script.

Reviewed-by: Peter Maydell <address@hidden>

-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]