[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] configure: disable clang -Wstring-plus-int warn
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH] configure: disable clang -Wstring-plus-int warning |
Date: |
Tue, 06 Aug 2013 09:22:22 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) |
Peter Maydell <address@hidden> writes:
> Some versions of clang will warn about adding integers to strings:
>
> disas/i386.c:4753:23: error: adding 'char' to a string does not append
> to the string [-Werror,-Wstring-plus-int]
> oappend ("%es:" + intel_syntax);
> ~~~~~~~^~~~~~~~~~~~~~
> disas/i386.c:4753:23: note: use array indexing to silence this warning
> oappend ("%es:" + intel_syntax);
> ^
> & [ ]
>
> disas/i386.c uses this idiom to to skip a "%" prefix if using intel
> rather than AT&T syntax. This seems like a reasonable thing to do,
> and I don't think anybody contributing to QEMU is likely to believe
> that '+' is a string concatenation operator in C, so just disable
> -Wstring-plus-int.
>
> Signed-off-by: Peter Maydell <address@hidden>
Yes, please.