-
Notifications
You must be signed in to change notification settings - Fork 3k
Fix Stream for IAR toolchain #9033
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
This is a follow-up to PR ARMmbed#8331; fixing the Stream methods not covered there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Main code change seems fine.
TESTS/mbed_platform/Stream/main.cpp
Outdated
* A qute from `man 3 fdopen`: | ||
* | ||
* Reads and writes may be intermixed on read/write streams in any order. Note | ||
* that ANSI C requires that a file positioning function intervene between |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still don't like this man page text, as it's paraphrasing what the standard actually says, inaccurately.
If you're going to put anything in, make it the standard text. From C99:
When a file is opened with update mode ('+' as the second or third character in the
above list of mode argument values), both input and output may be performed on the
associated stream. However, output shall not be directly followed by input without an
intervening call to the fflush function or to a file positioning function (fseek,
fsetpos, or rewind), and input shall not be directly followed by output without an
intervening call to a file positioning function, unless the input operation encounters end-of-
file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the spec quote as suggested.
Use C99 instead of Linux man entry.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me 👍
CI started |
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
Description
This is a follow-up to PR #8331; fixing the Stream methods not covered there. I also added a few more test cases to cover all of affected methods.
The workaround removed in #8331 was introduced in #770.
CC @deepikabhavnani @kjbracey-arm
Pull request type