-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Add strcspn and iscntrl to minimal libc #16451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add strcspn and iscntrl to minimal libc #16451
Conversation
|
All checks are passing now. Review history of this comment for details about previous failed status. |
From IEEE Std 1003.1-2017: The strcspn() function shall compute the length (in bytes) of the maximum initial segment of the string pointed to by s1 which consists entirely of bytes not from the string pointed to by s2. Signed-off-by: Tomasz Gorochowik <[email protected]>
From IEEE Std 1003.1-2017: The iscntrl() and function shall test whether the c is a character of class cntrl. Signed-off-by: Tomasz Gorochowik <[email protected]>
9eecf06 to
c515c24
Compare
pfalcon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should have "libc: minimal: add ..." titles, otherwise look good, thanks for improving minlibc.
nashif
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am reopening a branch I started working on last year to import a more complete base libc to replace minimal libc which includes all those functions you are adding.
Lets put this on hold, you can add those function to the sample for now while we try to get a more complete c library.
We already have "a more complete c library", it's called Newlib. What we need is to elaborate minimal libc, while keeping it minimal by the code size. Anyway, let's what that "more complete base libc" might be... |
more complete than the minimal libc but still minimal and basic that is part of the Zephyr project. So we agree. Not everyone wants or needs newlib. |
|
Has anyone looked into nano-newlib as a replacement for minimal libc? |
that is what I am looking into now. |
|
This PR adds the definitions for
strcspnandiscntrlto the minimal libc library (strings).