This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Bug in strlen on old MIPS CPUs


> 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)
 {




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]