This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
RE: Bug in strlen on old MIPS CPUs
- From: "Steve Legg" <smlegg at googlemail dot com>
- To: <newlib at sourceware dot org>
- Date: Tue, 21 Dec 2010 13:18:17 -0000
- Subject: RE: Bug in strlen on old MIPS CPUs
- References:
> but: is there a #define that can be checked to see if the CPU is
R2000/R3000?
It appears that GCC defines __R3000, so this would be a safe patch. The
same issue would happen on R2000, so possibly add || defined(__R2000) too,
but it's probably unlikely that anyone will ever compile newlib on such a
machine (if any still exist that aren't in museums or landfills ;).
--- newlib-1.18.0.orig//newlib/libc/machine/mips/strlen.c 2002-03-14
02:41:43 +0000
+++ newlib-1.18.0//newlib/libc/machine/mips/strlen.c 2010-12-21 05:22:00
+0000
@@ -20,7 +20,7 @@
/* MIPS16 needs to come first. */
-#if defined(__mips16)
+#if defined(__mips16) || defined(__R3000)
size_t
strlen (const char *str)
{