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

Fix iostream related issues #5047

Merged
merged 5 commits into from
Aug 26, 2018
Merged

Fix iostream related issues #5047

merged 5 commits into from
Aug 26, 2018

Conversation

igrr
Copy link
Member

@igrr igrr commented Aug 14, 2018

@igrr igrr requested a review from devyte August 14, 2018 20:42
std::stringstream test_stream("");
test_stream << "hello stream";

Serial.readString();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this needed ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as @d-a-v

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was meant to clean up UART RX buffer just in case there was something in there. Chances are, the test will also work without this.

And I have messed up the indentation in this line...

if (file == STDOUT_FILENO) {
while(len--) {
while(pos--) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this address a current issue or ongoing discussion? Maybe a link could be added in the PR description if that's the case.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't seen this reported, probably because including iostream header caused compilation error, so no one got as far as using iostreams. Found when writing the test case.

newlib provides its own implementation of _putc_r, which will call
_write_r (possibly after buffering). Make our implementation weak to
allow using the one from newlib.

Fixes #4630
Should return number of bytes written, actually returned zero. This
resulted in std::cout going into failed state after the first write.
@devyte devyte merged commit 0713a01 into master Aug 26, 2018
@devyte devyte deleted the bugfix/iostream_issues branch December 11, 2018 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants