PATCH: Fix undeclared variable error in memset.c
Nathanael Nerode
neroden@twcny.rr.com
Wed Nov 27 09:40:00 GMT 2002
"d" is declared in an inner block and then used in an outer block; this
causes a compile error, preventing newlib from finishing its build.
Fixed by moving declaration of "d" out of the "if" block.
Please tell me if this is OK to commit.
Index: memset.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/string/memset.c,v
retrieving revision 1.4
diff -u -r1.4 memset.c
--- memset.c 25 Nov 2002 21:11:58 -0000 1.4
+++ memset.c 27 Nov 2002 17:37:41 -0000
@@ -60,12 +60,12 @@
unsigned long buffer;
unsigned long *aligned_addr;
+ /* To avoid sign extention, copy C to an unsigned variable. */
+ unsigned int d = c & 0xff;
+
if (!TOO_SMALL (n) && !UNALIGNED (m))
{
/* If we get this far, we know that n is large and m is word-aligned. */
-
- /* To avoid sign extention, copy C to an unsigned variable. */
- unsigned int d = c & 0xff;
aligned_addr = (unsigned long*)m;
More information about the Newlib
mailing list