public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* New ARI warning Fri Oct  8 01:55:46 UTC 2010
@ 2010-10-08  1:55 GDB Administrator
  2010-10-26 14:52 ` [PATCH] avoid assignment inside if condition (dictionary.c) Joel Brobecker
  0 siblings, 1 reply; 2+ messages in thread
From: GDB Administrator @ 2010-10-08  1:55 UTC (permalink / raw)
  To: gdb-patches

4,5d3
< gdb/ada-lang.c:5016: code: OP eol: Do not use &&, or || at the end of a line
gdb/ada-lang.c:5016:	  else if (t1 == '.' &&
< gdb/ada-lang.c:5017: code: if assignment: An IF statement's expression contains an assignment (the GNU coding standard discourages this)
gdb/ada-lang.c:5017:	  else if (t1 == '.' &&		   (((t2 = name[2]) >= '.' && t2 <= '.') || t2 == target0))
231a230
> gdb/dictionary.c:830: code: if assignment: An IF statement's expression contains an assignment (the GNU coding standard discourages this)
gdb/dictionary.c:830:	      if (((c = string[2]) < '.' || c > '.') && c != '.')

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH] avoid assignment inside if condition (dictionary.c)
  2010-10-08  1:55 New ARI warning Fri Oct 8 01:55:46 UTC 2010 GDB Administrator
@ 2010-10-26 14:52 ` Joel Brobecker
  0 siblings, 0 replies; 2+ messages in thread
From: Joel Brobecker @ 2010-10-26 14:52 UTC (permalink / raw)
  To: gdb-patches; +Cc: Joel Brobecker

This change gets rid of an ARI warning which was recently introduced
by one of our changes.

gdb/ChangeLog:

        * dictionary.c (dict_hash): Move assignment out of if condition.

Tested on x86_64-linux, and checked in.

---
 gdb/ChangeLog    |    4 ++++
 gdb/dictionary.c |    5 +++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index a6fca05..99d24f4 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
+2010-10-26  Joel Brobecker  <brobecker@adacore.com>
+
+	* dictionary.c (dict_hash): Move assignment out of if condition.
+
 2010-10-22  Jie Zhang  <jie@codesourcery.com>
 
 	* Makefile.in (install): Remove dependency of install-only and
diff --git a/gdb/dictionary.c b/gdb/dictionary.c
index 4f18e8c..9d53ff0 100644
--- a/gdb/dictionary.c
+++ b/gdb/dictionary.c
@@ -798,7 +798,6 @@ dict_hash (const char *string0)
 
   const char *string;
   unsigned int hash;
-  int c;
 
   string = string0;
   if (*string == '_')
@@ -827,7 +826,9 @@ dict_hash (const char *string0)
 	case '_':
 	  if (string[1] == '_' && string != string0)
 	    {
-	      if (((c = string[2]) < 'a' || c > 'z') && c != 'O')
+	      int c = string[2];
+
+	      if ((c < 'a' || c > 'z') && c != 'O')
 		return hash;
 	      hash = 0;
 	      string += 2;
-- 
1.7.1

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-10-26 14:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-08  1:55 New ARI warning Fri Oct 8 01:55:46 UTC 2010 GDB Administrator
2010-10-26 14:52 ` [PATCH] avoid assignment inside if condition (dictionary.c) Joel Brobecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).