On Nov 8, 2013, at 2:35 AM, Mingjie Xing wrote:
> Oops, if it is not a bug, please close the report
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57258
Well, I've stated my position. I can be swayed by a good argument, if someone
has one. I'd give people a chance to weigh in if they can think
On Nov 8, 2013, at 2:25 AM, Bin.Cheng wrote:
> Thanks for elaborating. The warning message is actually for no-use of
> variable, and it has few things to do with whether it's accessed or
> not.
I disagree. If you examine why the warning was put in, you realize it was put
in so that lazy progra
Oops, if it is not a bug, please close the report
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57258
Thanks,
Mingjie
2013/11/8 Richard Biener :
> On Fri, Nov 8, 2013 at 10:39 AM, Mike Stump wrote:
>>
>> On Nov 8, 2013, at 1:32 AM, Bin.Cheng wrote:
>>
>>> On Fri, Nov 8, 2013 at 5:03 PM, Mike Stum
On Fri, Nov 8, 2013 at 5:39 PM, Mike Stump wrote:
>
> On Nov 8, 2013, at 1:32 AM, Bin.Cheng wrote:
>
>> On Fri, Nov 8, 2013 at 5:03 PM, Mike Stump wrote:
>>> On Nov 7, 2013, at 5:13 PM, Mingjie Xing wrote:
Well, it is my understanding that the warning should be emitted for a
volatile
On Fri, Nov 8, 2013 at 10:39 AM, Mike Stump wrote:
>
> On Nov 8, 2013, at 1:32 AM, Bin.Cheng wrote:
>
>> On Fri, Nov 8, 2013 at 5:03 PM, Mike Stump wrote:
>>> On Nov 7, 2013, at 5:13 PM, Mingjie Xing wrote:
Well, it is my understanding that the warning should be emitted for a
volatile
On Nov 8, 2013, at 1:32 AM, Bin.Cheng wrote:
> On Fri, Nov 8, 2013 at 5:03 PM, Mike Stump wrote:
>> On Nov 7, 2013, at 5:13 PM, Mingjie Xing wrote:
>>> Well, it is my understanding that the warning should be emitted for a
>>> volatile variable only if it is not accessed. Initialization means
On Fri, Nov 8, 2013 at 5:03 PM, Mike Stump wrote:
> On Nov 7, 2013, at 5:13 PM, Mingjie Xing wrote:
>> Well, it is my understanding that the warning should be emitted for a
>> volatile variable only if it is not accessed. Initialization means
>> accessing, even though it is not used anywhere.
>
On Nov 7, 2013, at 5:13 PM, Mingjie Xing wrote:
> Well, it is my understanding that the warning should be emitted for a
> volatile variable only if it is not accessed. Initialization means
> accessing, even though it is not used anywhere.
Let me try. A warning is useful, if there is no way a co
2013/11/7 Joseph S. Myers :
> On Thu, 7 Nov 2013, Mingjie Xing wrote:
>
>> 2013/11/6 Richard Biener :
>> > 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 upda
On Thu, 7 Nov 2013, Mingjie Xing wrote:
> 2013/11/6 Richard Biener :
> > 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.
You do
- warning_at (DECL_SOURCE_LOCATION (p),
- OPT_Wunused_but_set_variable,
- "variable %qD set but not used", p);
+ {
+if (!TREE_THIS_VOLATILE (p))
+ warning_at (DECL_SOURCE_LOCATION (p),
+OPT_Wunused_but_set_variable,
+"variable %qD set but not used", p);
+ }
I'd prefe
On Thu, Nov 7, 2013 at 11:53 AM, Mingjie Xing wrote:
> 2013/11/6 Richard Biener :
>> 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.
>
2013/11/6 Richard Biener :
> 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
* c-decl.c (pop_scope): Don
On Wed, 6 Nov 2013, Mingjie Xing wrote:
> * c/c-decl.c (pop_scope): Skip volatile variables while emit
> warnings for unused variables.
c/ has its own ChangeLog, so no c/ in the ChangeLog entries.
This patch doesn't include a testsuite addition.
--
Joseph S. Myers
jos...@codesourcery.c
On Wed, Nov 6, 2013 at 8:40 AM, Mingjie Xing wrote:
> Hi,
>
> Changes:
>
> * c/c-decl.c (pop_scope): Skip volatile variables while emit
> warnings for unused variables.
>
> Tested on i686-pc-linux-gnu.
>
> OK?
You miss a testcase.
Also why should the warning be omitted for unused automat
Hi,
Changes:
* c/c-decl.c (pop_scope): Skip volatile variables while emit
warnings for unused variables.
Tested on i686-pc-linux-gnu.
OK?
Mingjie
Index: gcc/c/c-decl.c
===
--- gcc/c/c-decl.c (revision 204285)
+++ gcc/c/c-d
16 matches
Mail list logo