This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: New ARI warning Fri Jul 27 01:55:31 UTC 2012
- From: Tom Tromey <tromey at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Fri, 27 Jul 2012 13:21:55 -0600
- Subject: Re: New ARI warning Fri Jul 27 01:55:31 UTC 2012
- References: <20120727015532.GA20167@sourceware.org>
>>>>> ">" == GDB Administrator <gdbadmin@sourceware.org> writes:
>> gdb/c-exp.y:2751: code: if assignment: An IF statement's expression
>> contains an assignment (the GNU coding standard discourages this)
>> gdb/c-exp.y:2751: if ((sym = lookup_struct_typedef (copy,
>> expression_context_block, 1)))
I'm checking in this fix.
Tom
2012-07-27 Tom Tromey <tromey@redhat.com>
* c-exp.y (classify_name): Avoid assignment in condition.
Index: c-exp.y
===================================================================
RCS file: /cvs/src/src/gdb/c-exp.y,v
retrieving revision 1.101
diff -u -r1.101 c-exp.y
--- c-exp.y 26 Jul 2012 20:11:09 -0000 1.101
+++ c-exp.y 27 Jul 2012 19:21:07 -0000
@@ -2747,8 +2747,8 @@
if (Class)
{
yylval.class.class = Class;
- if ((sym = lookup_struct_typedef (copy, expression_context_block,
- 1)))
+ sym = lookup_struct_typedef (copy, expression_context_block, 1);
+ if (sym)
yylval.class.type = SYMBOL_TYPE (sym);
return CLASSNAME;
}