This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C] Fix PR57258: unused variable warning is emitted for volatile variables
- From: "Bin.Cheng" <amker dot cheng at gmail dot com>
- To: Mingjie Xing <mingjie dot xing at gmail dot com>
- Cc: Richard Biener <richard dot guenther at gmail dot com>, "Joseph S. Myers" <joseph at codesourcery dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 7 Nov 2013 15:37:37 +0800
- Subject: Re: [C] Fix PR57258: unused variable warning is emitted for volatile variables
- Authentication-results: sourceware.org; auth=none
- References: <CADNgcEwhF9u2S=f3GdLtWo98BBQs-BVdzRh7-mspQHBAHhUYaw at mail dot gmail dot com> <CAFiYyc1OtvdCoawpsSStPF=qZJN+DHJUy_Hn=6a=9Tmk0uPp6g at mail dot gmail dot com> <CADNgcEzv0gdtADDwE1V4yn1ruwVE32eOocXk_HmLtcPhDiWu3w at mail dot gmail dot com>
On Thu, Nov 7, 2013 at 11:53 AM, Mingjie Xing <mingjie.xing@gmail.com> wrote:
> 2013/11/6 Richard Biener <richard.guenther@gmail.com>:
>> You miss a testcase.
>>
>> Also why should the warning be omitted for unused automatic
>> volatile variables? They cannot be used in any way.
>>
>> Richard.
>
> Thanks. I've updated the patch with a test case.
>
> c/ChangeLog
>
> PR 57258
Should be:
PR c/57258
Thanks,
bin
> * c-decl.c (pop_scope): Don't emit unused variable warnings for
> accessed volatile variables.
>
> testsuite/ChangeLog
>
> * gcc.dg/Wunused-var-4.c: New test.
>
> Mingjie
--
Best Regards.