Skip to content

Conversation

@tgorochowik
Copy link
Member

This PR adds the definitions for strcspn and iscntrl to the minimal libc library (strings).

@tgorochowik tgorochowik added the area: C Library C Standard Library label May 28, 2019
@zephyrbot
Copy link

zephyrbot commented May 28, 2019

All checks are passing now.

Review history of this comment for details about previous failed status.
Note that some checks might have not completed yet.

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]>
@tgorochowik tgorochowik force-pushed the extra-string-functions branch from 9eecf06 to c515c24 Compare May 28, 2019 14:33
Copy link
Contributor

@pfalcon pfalcon left a 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.

Copy link
Member

@nashif nashif left a 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.

@pfalcon
Copy link
Contributor

pfalcon commented Jun 6, 2019

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...

@nashif
Copy link
Member

nashif commented Jun 6, 2019

a more complete c library

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.

@andrewboie
Copy link
Contributor

Has anyone looked into nano-newlib as a replacement for minimal libc?
Really we need to get out of the C library business...I would prefer we just moved to third-party C libraries we can add to the west manifest and purged minimal libc from the tree completely

@nashif
Copy link
Member

nashif commented Jun 6, 2019

Has anyone looked into nano-newlib as a replacement for minimal libc?

that is what I am looking into now.

@KozhinovAlexander
Copy link
Contributor

KozhinovAlexander commented Sep 25, 2020

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.

@nashif

  • Could you please provide the link to your active working new new libc implementation here?
  • Can I also participate on meaning by you PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: C Library C Standard Library Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants