Re: another -Wunsequenced topic

From: <dt71_at_gmx.com>
Date: Sun, 30 Jun 2013 16:13:59 +0200
There are more.

Take the first hunk with caution.

Index: contrib/gdb/gdb/dwarf2-frame.c
===================================================================
--- contrib/gdb/gdb/dwarf2-frame.c	(revision 252384)
+++ contrib/gdb/gdb/dwarf2-frame.c	(working copy)
_at__at_ -1361,7 +1361,7 _at__at_
  	  else if (*augmentation == 'P')
  	    {
  	      /* Skip.  */
-	      buf += size_of_encoded_value (*buf++);
+	      buf += size_of_encoded_value (*buf) + 1;
  	      augmentation++;
  	    }
  
Index: usr.sbin/moused/moused.c
===================================================================
--- usr.sbin/moused/moused.c	(revision 252384)
+++ usr.sbin/moused/moused.c	(working copy)
_at__at_ -2455,7 +2455,7 _at__at_
  	    return (FALSE);
  	lbutton = atoi(s);
  
-	arg = skipspace(++arg);
+	arg = skipspace(arg + 1);
  	s = arg;
  	while (isdigit(*arg))
  	    ++arg;
Index: lib/libstand/nfs.c
===================================================================
--- lib/libstand/nfs.c	(revision 252384)
+++ lib/libstand/nfs.c	(working copy)
_at__at_ -1465,8 +1465,9 _at__at_
  	d->d_name[d->d_namlen] = '\0';
  
  	pos = roundup(d->d_namlen, sizeof(uint32_t)) / sizeof(uint32_t);
-	fp->off = cookie = ((uint64_t)ntohl(rent->nameplus[pos++]) << 32) |
-	    ntohl(rent->nameplus[pos++]);
+	fp->off = cookie = ((uint64_t)ntohl(rent->nameplus[pos]) << 32) |
+	    ntohl(rent->nameplus[pos + 1]);
+	pos += 2;
  	buf = (u_char *)&rent->nameplus[pos];
  	return (0);
  }
Index: contrib/sendmail/src/recipient.c
===================================================================
--- contrib/sendmail/src/recipient.c	(revision 252384)
+++ contrib/sendmail/src/recipient.c	(working copy)
_at__at_ -1834,7 +1834,7 _at__at_
  
  		/* <sp>#_at_# introduces a comment anywhere */
  		/* for Japanese character sets */
-		for (p = buf; (p = strchr(++p, '#')) != NULL; )
+		for (p = buf; (p = strchr(p + 1, '#')) != NULL; )
  		{
  			if (p[1] == '_at_' && p[2] == '#' &&
  			    isascii(p[-1]) && isspace(p[-1]) &&
Index: usr.sbin/pkg_install/create/perform.c
===================================================================
--- usr.sbin/pkg_install/create/perform.c	(revision 252384)
+++ usr.sbin/pkg_install/create/perform.c	(working copy)
_at__at_ -149,7 +149,7 _at__at_
  
  	/* Count number of dependencies */
  	for (cp = Pkgdeps; cp != NULL && *cp != '\0';
-			   cp = strpbrk(++cp, " \t\n")) {
+			   cp = strpbrk(cp + 1, " \t\n")) {
  	    ndeps++;
  	}
  
Received on Sun Jun 30 2013 - 12:14:35 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:39 UTC