Skip to content
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

libc: minimal: add strerror() function #46099

Closed
cfriedt opened this issue May 29, 2022 · 0 comments · Fixed by #46101
Closed

libc: minimal: add strerror() function #46099

cfriedt opened this issue May 29, 2022 · 0 comments · Fixed by #46101
Assignees
Labels
area: Minimal libc Minimal C Standard Library Enhancement Changes/Updates/Additions to existing features

Comments

@cfriedt
Copy link
Member

cfriedt commented May 29, 2022

Is your enhancement proposal related to a problem? Please describe.
An issue with portability is the lack of a strerror() function.

However, it is understandable why the function is not included (the string table increases ROM footprint and we want to keep Zephyr small).

It's an annoyance to have to #ifdef-out sections of 3rd-party code that rely on its presence.

Describe the solution you'd like
A functional strerror() with a Kconfig option to enable the string error table.

Describe alternatives you've considered
#ifdef-ing out code in 3rd-party libraries ad-infinitum.

Additional context
Useful for perror()

@cfriedt cfriedt added Enhancement Changes/Updates/Additions to existing features area: Minimal libc Minimal C Standard Library labels May 29, 2022
@cfriedt cfriedt self-assigned this May 29, 2022
@cfriedt cfriedt changed the title libc: minimal: strerror function missing libc: minimal: add strerror() function May 29, 2022
cfriedt added a commit to cfriedt/zephyr that referenced this issue Jul 2, 2022
Add simple strerror() and strerror_r() implementations.

Fixes zephyrproject-rtos#46099

Signed-off-by: Christopher Friedt <cfriedt@fb.com>
carlescufi pushed a commit that referenced this issue Jul 4, 2022
Add simple strerror() and strerror_r() implementations.

Fixes #46099

Signed-off-by: Christopher Friedt <cfriedt@fb.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Minimal libc Minimal C Standard Library Enhancement Changes/Updates/Additions to existing features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant