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

sys/newlib: Update _read_r and _write_r to match newlib prototypes in reent.h #5249

Merged
merged 1 commit into from
Apr 6, 2016

Conversation

jnohlgard
Copy link
Member

Another bugfix for the newlib syscalls. Fixes an error message when running make scan-build with TOOLCHAIN=gnu

See also reent.h in your local cross toolchain installation

@jnohlgard jnohlgard added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) Platform: ARM Platform: This PR/issue effects ARM-based platforms Impact: minor The PR is small in size and might only require a quick look of a knowledgeable reviewer Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Apr 6, 2016
@@ -186,7 +186,7 @@ int _open_r(struct _reent *r, const char *name, int flags, int mode)
*
* @return TODO
*/
int _read_r(struct _reent *r, int fd, void *buffer, unsigned int count)
_ssize_t _read_r(struct _reent *r, int fd, void *buffer, size_t count)
Copy link
Member

Choose a reason for hiding this comment

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

Has nothing to do with this PR, but what's the difference between _ssize_t and ssize_t?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it's just because newlib doesn't want to pollute the namespace and only defines names starting with underscore. There's a typedef in the cross toolchain headers typedef ssize_t _ssize_t.

Copy link
Contributor

Choose a reason for hiding this comment

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

Basically there is no difference. sys/_types.h defines _ssize_t, and sys/types.h then does typedef _ssize_t ssize_t. sys/types.h transcludes further headers, and I guess _ssize_t is used in prototypes to keep transclusions cycle free, i.e. the headers only have to depend on sys/_types.h.

@OlegHahm
Copy link
Member

OlegHahm commented Apr 6, 2016

ACK and go!

@OlegHahm OlegHahm added this to the Release 2016.04 milestone Apr 6, 2016
@OlegHahm OlegHahm merged commit 5b38659 into RIOT-OS:master Apr 6, 2016
@jnohlgard jnohlgard deleted the pr/newlib-readwrite-prototypes branch April 6, 2016 11:13
@cgundogan
Copy link
Member

might this also need a backport?

@jnohlgard
Copy link
Member Author

Wasn't this merged before the release candidate fork?
On Apr 15, 2016 12:50 PM, "Cenk Gündoğan" notifications@github.com wrote:

might this also need a backport?


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#5249 (comment)

@cgundogan
Copy link
Member

Yes sorry
Am 15.04.2016 13:05 schrieb "Joakim Nohlgård" notifications@github.com:

Wasn't this merged before the release candidate fork?
On Apr 15, 2016 12:50 PM, "Cenk Gündoğan" notifications@github.com
wrote:

might this also need a backport?


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#5249 (comment)


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#5249 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Impact: minor The PR is small in size and might only require a quick look of a knowledgeable reviewer Platform: ARM Platform: This PR/issue effects ARM-based platforms Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants