This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: New ARI warning Fri Jul 27 01:55:31 UTC 2012


>>>>> ">" == 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;
 	}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]