From: Chen Gang <gang.chen.5i5j@gmail.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel <qemu-devel@nongnu.org>, Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH v2] libvixl: a64: Skip "-Wunused-variable" for gcc 5.0.0 or higher
Date: Sun, 12 Oct 2014 08:32:47 +0800 [thread overview]
Message-ID: <5439CC2F.2050702@gmail.com> (raw)
In-Reply-To: <CAFEAcA_c7FE93J_7ZTqZaMG3V6Xx+EW6kAYF6XBqO9YL28+1mg@mail.gmail.com>
On 10/12/14 5:25, Peter Maydell wrote:
> On 11 October 2014 15:13, Chen Gang <gang.chen.5i5j@gmail.com> wrote:
>
> MJT: please don't put this in -trivial, it will clash with
> the update to libvixl 1.6 currently on the list.
>
OK thanks (also remove -trivial from replying mailing list).
>
>> On 10/11/14 22:07, Chen Gang wrote:
>>> 'instructions-a64.h' has unused variables for qemu which can be found by
>>> gcc 5.0.0 or higher. and qemu needs "-Werror", and cause building break.
>>> But they may be used by another projects (not qemu).
>>>
>>> So for gcc 5.0.0 or higher, need still keep them, but ignore diagnostic
>>> (still print warning, but not break building). The related warnings:
>>>
>>> CXX disas/arm-a64.o
>>> In file included from /upstream/qemu/disas/libvixl/a64/disasm-a64.h:32:0,
>>> from disas/arm-a64.cc:20:
>>> disas/libvixl/a64/instructions-a64.h:98:13: error: 'vixl::kFP32PositiveInfinity' defined but not used [-Werror=unused-variable]
>>> const float kFP32PositiveInfinity = rawbits_to_float(0x7f800000);
>>> ^
>>> disas/libvixl/a64/instructions-a64.h:99:13: error: 'vixl::kFP32NegativeInfinity' defined but not used [-Werror=unused-variable]
>
> So, several questions here:
>
> (1) Does anybody know how the header in question should be
> providing constant floats and doubles to its users in a way
> that doesn't cause gcc to complain? If so, I can pass the
> answer along so at least the next version of the library
> is OK...
>
Hmm... may try to simplify rawbits_to_float() and rawbits_to_double() to
let gcc know about it is only for constant? (it seems original authors
intended to do it in function, I shall try to know why)
I shall try to get a conclusion within this month.
> (2) Bonus question, anybody know why gcc is perfectly happy
> with the unused integer constants in the .h file but doesn't
> like the float and doubles?
>
For (2), they use a real function rawbits_to_float(), is it gcc own
issue? I shall try to analyze it (at present, I am also upstream gcc
members, and make a patch for it per month).
I shall try to finish analyzing within this month.
> (3) Does gcc 5 emit these warnings for all the .cc files
> that pull in this header, or only for the arm-a64.cc one?
>
For (3), yes, it is, so I have to let it in header again.
> Some other approaches to this that would confine the
> fix to the makefiles rather than requiring us to modify
> the vixl source itself:
> a) add a -Wno- option for the affected .o files
It is one way, but may have effect with gcc 4 version, and also it is
effect with the whole file which is wider than current way.
> b) use -isystem rather than -I to include the libvixl
> directory on the include path
>
It sounds good to me, although for me, it is not related with current
issue.
Thanks
--
Chen Gang
Open, share, and attitude like air, water, and life which God blessed
next prev parent reply other threads:[~2014-10-12 0:27 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-11 14:07 [Qemu-trivial] [PATCH v2] libvixl: a64: Skip "-Wunused-variable" for gcc 5.0.0 or higher Chen Gang
2014-10-11 14:07 ` [Qemu-devel] " Chen Gang
2014-10-11 14:13 ` [Qemu-trivial] " Chen Gang
2014-10-11 14:13 ` [Qemu-devel] " Chen Gang
2014-10-11 21:25 ` [Qemu-trivial] " Peter Maydell
2014-10-11 21:25 ` [Qemu-devel] " Peter Maydell
2014-10-12 0:32 ` Chen Gang [this message]
2014-10-12 7:50 ` Peter Maydell
2014-10-12 11:19 ` Chen Gang
2014-10-13 14:59 ` Eric Blake
2014-10-13 15:07 ` Peter Maydell
2014-10-14 19:58 ` [Qemu-trivial] " Michael Tokarev
2014-10-14 19:58 ` [Qemu-devel] " Michael Tokarev
2014-10-14 20:47 ` Chen Gang
2014-10-14 20:47 ` [Qemu-devel] " Chen Gang
2014-10-15 9:55 ` Chen Gang
2014-10-15 9:55 ` [Qemu-devel] " Chen Gang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5439CC2F.2050702@gmail.com \
--to=gang.chen.5i5j@gmail.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.