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

tests/c_lib: strerror_r is POSIX #58460

Closed

Conversation

keith-packard
Copy link
Collaborator

Add "#define _POSIX_C_SOURCE 200809" so that picolibc will declare the complete POSIX API, including strerror_r, not just the Zephyr C library API.

stephanosio
stephanosio previously approved these changes May 31, 2023
@keith-packard
Copy link
Collaborator Author

Looks like we'll have to wait for the SDK used by CI to get updated to one with picolibc's _ZEPHYR_SOURCE support?

@keith-packard
Copy link
Collaborator Author

Fixed a commit message which needed word wrapping for the Compliance Checks.

@cfriedt
Copy link
Member

cfriedt commented Jun 16, 2023

Looks pretty close.

This is definitely on the roadmap. I'm hoping we can tie Konfig into POSIX feature test macros / version specifiers.

@keith-packard
Copy link
Collaborator Author

Looks pretty close.

This is definitely on the roadmap. I'm hoping we can tie Konfig into POSIX feature test macros / version specifiers.

Thanks. This depends on an SDK that supports _ZEPHYR_SOURCE; when that starts getting used in CI, it should "just work". I'm trying to get all of my changes queued up and ready to land after 3.4.0 is done.

@github-actions
Copy link

This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.

@github-actions github-actions bot added the Stale label Aug 16, 2023
@cfriedt cfriedt removed the Stale label Aug 17, 2023
@kartben
Copy link
Collaborator

kartben commented Sep 28, 2023

@keith-packard did you want to rebase / can this now go in?

@keith-packard
Copy link
Collaborator Author

keith-packard commented Sep 28, 2023

@keith-packard did you want to rebase / can this now go in?

Thanks for the reminder -- I'll poke at this later today or tomorrow; I'm working on not enabling malloc by default today in between meetings (saves a few hundred bytes in apps not using malloc).

The Zephyr C Standard Library Usage Restrictions defines an additional set
of interfaces beyond the ISO/ICE 9899:2011 standard (C11), but that does
not include strerror_r. That function is only available under the POSIX
specification.

Always define _POSIX_C_SOURCE 200809 so that picolibc and newlib, and any
other C libraries which offer both C11 and POSIX will declare strerror_r.

Signed-off-by: Keith Packard <[email protected]>
Don't ask picolibc to expose the full POSIX API by default, instead have it
only define the Zephyr API.

Signed-off-by: Keith Packard <[email protected]>
@keith-packard
Copy link
Collaborator Author

all done; let's see if CI agrees with my local twister run.

Copy link

github-actions bot commented Dec 3, 2023

This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.

@github-actions github-actions bot added the Stale label Dec 3, 2023
@github-actions github-actions bot closed this Dec 19, 2023
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.

5 participants