PERFORCE change 30865 for review

Peter Wemm peter at FreeBSD.org
Fri May 9 11:41:18 PDT 2003


http://perforce.freebsd.org/chv.cgi?CH=30865

Change 30865 by peter at peter_daintree on 2003/05/09 11:40:35

	bracket the bug workarounds with #ifdef BUG.  This seems to be
	fixed in gcc-3.3, or its related to the ptrdiff_t size bug somehow.

Affected files ...

.. //depot/projects/hammer/sys/kern/subr_scanf.c#5 edit
.. //depot/projects/hammer/sys/net/radix.c#5 edit

Differences ...

==== //depot/projects/hammer/sys/kern/subr_scanf.c#5 (text+ko) ====

@@ -498,7 +498,11 @@
 				}
 				goto match_failure;
 			}
+#ifdef BUG
+			c = ((u_char *)p)[-1];
+#else
 			c = (((u_char *)p) - 1)[0];
+#endif
 			if (c == 'x' || c == 'X') {
 				--p;
 				inp--;

==== //depot/projects/hammer/sys/net/radix.c#5 (text+ko) ====

@@ -451,7 +451,11 @@
 	/*
 	 * Trim trailing zeroes.
 	 */
+#ifdef BUG
+	for (cp = addmask_key + mlen; (cp > addmask_key) && cp[-1] == 0;)
+#else
 	for (cp = addmask_key + mlen; (cp > addmask_key) && *(cp - 1)  == 0;)
+#endif
 		cp--;
 	mlen = cp - addmask_key;
 	if (mlen <= skip) {


More information about the p4-projects mailing list