Weird behaviour of the strtok function #119
JiriBilek
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Juraj,
Recently, I found a strange behaviour of the strtok function in the Newlib library for Arm microcontrollers. However, I didn't see it in AVR.
There are two functions with similar behaviour: strtok and strtok_r. I noticed that the binary size of an application is reduced by more than 4K when using strtok_r instead of strtok. I believe this is a bug in the Newlib library because in the .map file you can see that an assertion routine and a large assertion text are linked to the binary when using strtok.
I share this with you because you use strtok heavily in this library.
You can try it with this simple code:
For stm32duino core and for example Generic STM32F1 Series, BluePill F103C6 (32K) and Newlib Nano library I get
and:
gives:
Beta Was this translation helpful? Give feedback.
All reactions