From: Chen Gang <gang.chen.5i5j@gmail.com>
To: Michael Tokarev <mjt@tls.msk.ru>
Cc: Peter Maydell <peter.maydell@linaro.org>,
Jonathan Wakely <jwakely.gcc@gmail.com>,
QEMU Trivial <qemu-trivial@nongnu.org>,
qemu-devel <qemu-devel@nongnu.org>,
Eric Blake <eblake@redhat.com>,
Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-trivial] [PATCH v2] libvixl: a64: Skip "-Wunused-variable" for gcc 5.0.0 or higher
Date: Wed, 15 Oct 2014 17:55:59 +0800 [thread overview]
Message-ID: <543E44AF.6070800@gmail.com> (raw)
In-Reply-To: <543D8BCB.2020109@gmail.com>
On 10/15/14 4:47, Chen Gang wrote:
> On 10/15/2014 03:58 AM, Michael Tokarev wrote:
>>
>> That's what I'm after too (after trying to fix it properly).
>> And no, at this time I dont know how gcc5 handles this.
>>
>
> At present, I have sent the related information to gcc upstream mailing
> list for gcc5, we are just discussing about it.
>
> - Some gcc members stick to what gcc5 has done is correct (need still
> report warning).
>
> - But for me, I am just trying to get another gcc members' confirmation.
> I am not quite familiar with C++, for me it is a complex language, so
> I need additional confirmation by another gcc members, at least.
>
After consult the gcc related members, we are sure what gcc has done is
correct, and need process this warning in our qemu or 'libvixl'.
The related mail is below:
-------- Forwarded Message --------
Subject: Re: [Consult] g++: About "-Wunused-variable" for constant variable in header file
Date: Wed, 15 Oct 2014 10:18:44 +0100
From: Jonathan Wakely <jwakely.gcc@gmail.com>
To: Chen Gang <gang.chen.5i5j@gmail.com>
CC: gcc-help <gcc-help@gcc.gnu.org>, Jeff Law <law@redhat.com>, Peter Maydell <peter.maydell@linaro.org>
On 14 October 2014 22:57, Chen Gang <gang.chen.5i5j@gmail.com> wrote:
> Hello All:
>
> At present, I met one warning issue about gcc 5.0.0.
>
> - For "const float a = 3.4 - 2.1 / 3;", if it is unused, gcc5 will not
> report warning.
Because there is no cost to initializing the variable.
> - "const char n() {return 1;}; const a = n();", if 'a' is unused, gcc5
> will report warning.
Because it requires dynamic initialization, running a function at
startup, which has a cost. If you don't use the variable then you
might not want to run the initialization code at startup, so you get a
warning.
> For gcc old version (e.g. gcc4), it will not report warning. Is it the
> new feature for gcc5, or just a gcc5's bug?
I think this behaviour is intended and is not a bug.
--
Chen Gang
Open, share, and attitude like air, water, and life which God blessed
WARNING: multiple messages have this Message-ID (diff)
From: Chen Gang <gang.chen.5i5j@gmail.com>
To: Michael Tokarev <mjt@tls.msk.ru>
Cc: Peter Maydell <peter.maydell@linaro.org>,
Jonathan Wakely <jwakely.gcc@gmail.com>,
QEMU Trivial <qemu-trivial@nongnu.org>,
qemu-devel <qemu-devel@nongnu.org>,
Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [Qemu-trivial] [PATCH v2] libvixl: a64: Skip "-Wunused-variable" for gcc 5.0.0 or higher
Date: Wed, 15 Oct 2014 17:55:59 +0800 [thread overview]
Message-ID: <543E44AF.6070800@gmail.com> (raw)
In-Reply-To: <543D8BCB.2020109@gmail.com>
On 10/15/14 4:47, Chen Gang wrote:
> On 10/15/2014 03:58 AM, Michael Tokarev wrote:
>>
>> That's what I'm after too (after trying to fix it properly).
>> And no, at this time I dont know how gcc5 handles this.
>>
>
> At present, I have sent the related information to gcc upstream mailing
> list for gcc5, we are just discussing about it.
>
> - Some gcc members stick to what gcc5 has done is correct (need still
> report warning).
>
> - But for me, I am just trying to get another gcc members' confirmation.
> I am not quite familiar with C++, for me it is a complex language, so
> I need additional confirmation by another gcc members, at least.
>
After consult the gcc related members, we are sure what gcc has done is
correct, and need process this warning in our qemu or 'libvixl'.
The related mail is below:
-------- Forwarded Message --------
Subject: Re: [Consult] g++: About "-Wunused-variable" for constant variable in header file
Date: Wed, 15 Oct 2014 10:18:44 +0100
From: Jonathan Wakely <jwakely.gcc@gmail.com>
To: Chen Gang <gang.chen.5i5j@gmail.com>
CC: gcc-help <gcc-help@gcc.gnu.org>, Jeff Law <law@redhat.com>, Peter Maydell <peter.maydell@linaro.org>
On 14 October 2014 22:57, Chen Gang <gang.chen.5i5j@gmail.com> wrote:
> Hello All:
>
> At present, I met one warning issue about gcc 5.0.0.
>
> - For "const float a = 3.4 - 2.1 / 3;", if it is unused, gcc5 will not
> report warning.
Because there is no cost to initializing the variable.
> - "const char n() {return 1;}; const a = n();", if 'a' is unused, gcc5
> will report warning.
Because it requires dynamic initialization, running a function at
startup, which has a cost. If you don't use the variable then you
might not want to run the initialization code at startup, so you get a
warning.
> For gcc old version (e.g. gcc4), it will not report warning. Is it the
> new feature for gcc5, or just a gcc5's bug?
I think this behaviour is intended and is not a bug.
--
Chen Gang
Open, share, and attitude like air, water, and life which God blessed
next prev parent reply other threads:[~2014-10-15 9:50 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
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 [this message]
2014-10-15 9:55 ` 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=543E44AF.6070800@gmail.com \
--to=gang.chen.5i5j@gmail.com \
--cc=eblake@redhat.com \
--cc=jwakely.gcc@gmail.com \
--cc=mjt@tls.msk.ru \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@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.