-
Notifications
You must be signed in to change notification settings - Fork 7.6k
libc: picolibc: fputc should return the value it has written #74629
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
Conversation
If I recall correctly, this is an internal implementation detail of the picolibc layer for Zephyr -- the actual |
c805bf9
to
357a405
Compare
I think you are right. In that case, what's the role of |
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. |
According to the documentations: - en.cppreference.com/w/c/io/fputc - pubs.opengroup.org/onlinepubs/9699919799/functions/fputc.html Return value - On success, returns the written character. - On failure, returns EOF and sets the error indicator (see ferror()) on stream. This commit changes it to return the written value on success, and EOF if failed, which is the same as minimal libc, but the error indicator is still not set. Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com> Signed-off-by: Yong Cong Sin <ycsin@meta.com>
357a405
to
9ac7df5
Compare
|
I think I already responded to this appropriately -- you are mis-understanding how these functions are used; they are implementation details specific to supporting the picolibc stdio stack on Zephyr. They are not the POSIX API used by applications. |
According to the documentations:
This commit changes it to return the written value on success, and EOF if failed, which is the same as minimal libc, but the error indicator is still not set.
zephyr/lib/libc/minimal/source/stdout/stdout_console.c
Lines 28 to 31 in 901a8f7