* [Qemu-devel] [PATCH] configure: disable clang -Wstring-plus-int warning
@ 2013-08-05 19:16 Peter Maydell
2013-08-06 7:22 ` Markus Armbruster
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Peter Maydell @ 2013-08-05 19:16 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, patches
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 <peter.maydell@linaro.org>
---
configure | 1 +
1 file changed, 1 insertion(+)
diff --git a/configure b/configure
index a3bd9be..a1d1701 100755
--- a/configure
+++ b/configure
@@ -1204,6 +1204,7 @@ gcc_flags="-Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers $gcc_
gcc_flags="-Wmissing-include-dirs -Wempty-body -Wnested-externs $gcc_flags"
gcc_flags="-Wendif-labels $gcc_flags"
gcc_flags="-Wno-initializer-overrides $gcc_flags"
+gcc_flags="-Wno-string-plus-int $gcc_flags"
# Note that we do not add -Werror to gcc_flags here, because that would
# enable it for all configure tests. If a configure test failed due
# to -Werror this would just silently disable some features,
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] configure: disable clang -Wstring-plus-int warning
2013-08-05 19:16 [Qemu-devel] [PATCH] configure: disable clang -Wstring-plus-int warning Peter Maydell
@ 2013-08-06 7:22 ` Markus Armbruster
2013-08-20 13:01 ` Peter Maydell
2013-09-01 15:07 ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev
2 siblings, 0 replies; 4+ messages in thread
From: Markus Armbruster @ 2013-08-06 7:22 UTC (permalink / raw)
To: Peter Maydell; +Cc: qemu-trivial, qemu-devel, patches
Peter Maydell <peter.maydell@linaro.org> 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 <peter.maydell@linaro.org>
Yes, please.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] configure: disable clang -Wstring-plus-int warning
2013-08-05 19:16 [Qemu-devel] [PATCH] configure: disable clang -Wstring-plus-int warning Peter Maydell
2013-08-06 7:22 ` Markus Armbruster
@ 2013-08-20 13:01 ` Peter Maydell
2013-09-01 15:07 ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev
2 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2013-08-20 13:01 UTC (permalink / raw)
To: QEMU Developers; +Cc: QEMU Trivial, Patch Tracking
Ping for qemu-trivial now 1.7 is open.
thanks
-- PMM
On 5 August 2013 20:16, Peter Maydell <peter.maydell@linaro.org> wrote:
> 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 <peter.maydell@linaro.org>
> ---
> configure | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/configure b/configure
> index a3bd9be..a1d1701 100755
> --- a/configure
> +++ b/configure
> @@ -1204,6 +1204,7 @@ gcc_flags="-Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers $gcc_
> gcc_flags="-Wmissing-include-dirs -Wempty-body -Wnested-externs $gcc_flags"
> gcc_flags="-Wendif-labels $gcc_flags"
> gcc_flags="-Wno-initializer-overrides $gcc_flags"
> +gcc_flags="-Wno-string-plus-int $gcc_flags"
> # Note that we do not add -Werror to gcc_flags here, because that would
> # enable it for all configure tests. If a configure test failed due
> # to -Werror this would just silently disable some features,
> --
> 1.7.9.5
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [Qemu-trivial] [PATCH] configure: disable clang -Wstring-plus-int warning
2013-08-05 19:16 [Qemu-devel] [PATCH] configure: disable clang -Wstring-plus-int warning Peter Maydell
2013-08-06 7:22 ` Markus Armbruster
2013-08-20 13:01 ` Peter Maydell
@ 2013-09-01 15:07 ` Michael Tokarev
2 siblings, 0 replies; 4+ messages in thread
From: Michael Tokarev @ 2013-09-01 15:07 UTC (permalink / raw)
To: Peter Maydell; +Cc: qemu-trivial, qemu-devel, patches
05.08.2013 23:16, Peter Maydell wrote:
> 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.
Thanks, applied to the trivial-patches queue.
/mjt
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-09-01 15:07 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-05 19:16 [Qemu-devel] [PATCH] configure: disable clang -Wstring-plus-int warning Peter Maydell
2013-08-06 7:22 ` Markus Armbruster
2013-08-20 13:01 ` Peter Maydell
2013-09-01 15:07 ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).