Strange problem with newlib strstr function and rtems 4.10 on coldfire

Paul Whitfield paulw at
Mon Apr 18 04:28:46 UTC 2011

On 18/04/2011 10:51 AM, Paul Whitfield wrote:
> Hello All,
> I have a weird problem with the strstr function seeming to not work
> correctly on Rtems 4.10 with a Coldfire processor.
> The problem is that strstr appears to be matching on where there is no
> match!

Just some more info, if I import the strstr.c / str-two-way.h files
into my project and compile them locally I get the same issue.

However, if define PREFER_SIZE_OVER_SPEED in the strstr.c module, then 
the code works as I expect and I get the correct match.

I have checked the newlib CVS and the version of strstr.c and 
str-two-way.h in RTEMS4-10 are update to date with the most current

One last note: Recompiling the strstr.c / str-two-way.h code newlib code 
on the PC the code works correctly with the optimised version.


Message  protected by MailGuard: e-mail anti-virus, anti-spam and content filtering.

More information about the users mailing list