Conversation
Also include interaction with stdio, as corrupting output on mixing stdio and fmt is too much of a footgun.
|
@kaspar030 can you have a look at this? |
|
I also sneaked in an |
kaspar030
left a comment
There was a problem hiding this comment.
ACK.
This does now adds a dependency of fmt to newlib's stdio code (+200b for a print_str("foo\n") for an otherwise -DLOG_LEVEL=LOG_NONE build). But, no more broken output.
|
Maybe should consider making picolibc the default. I was told @benpicco is suggesting just that for a few month now :) |
Use fwrite instead of write to not bypass caching stdio. Other fmt's print function are too much of a footgun to use.
|
I added special handling for It seems that consistent behavior among the different implementations is a bit more involved that I have hoped for, so lets run tests to be sure. I disabled the auto merge in case someone wants to take a look at the changes. |
|
looks like the ESP32s from the pi fleet are unplugged / broken. But other than that this seems to be ready now |
|
All green now |
|
Thx! |
Contribution description
Mixing
print*()fromfmt.hwithputs()*printf()fromstdio.hresults in corrupted output even with only one thread printing. That's an obvious footgun. This fixes the issue.Testing procedure
The first commit extends
tests/fmt_printto detect output corruptions when mixing withstdio.h(this should fail onmaster). The second fixes the issue (so it should pass again after the second commit).Issues/PRs references
Alternative to dropping the use of
fmtin #18161