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

mbed_retarget: enable IAR build #14935

Merged
merged 1 commit into from
Aug 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion platform/include/platform/mbed_retarget.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#endif
#include <errno.h>

#if !defined(__ARMCC_VERSION)
#if !defined(__ARMCC_VERSION) && defined(__GNUC__)
Copy link
Contributor

Choose a reason for hiding this comment

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

is this addition needed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

#include <fcntl.h>
#endif

Expand Down Expand Up @@ -468,9 +468,16 @@ typedef struct DIR_impl DIR;
#ifndef ELIBEXEC
#define ELIBEXEC 83 /* Cannot exec a shared library directly */
#endif

#if defined ( __ICCARM__ )
#undef EILSEQ /* defined in IAR arm/inc/c/errno.h: #define EILSEQ 36 */
#define EILSEQ 84 /* Illegal byte sequence */
Copy link
Contributor

@0xc0170 0xc0170 Jul 21, 2021

Choose a reason for hiding this comment

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

I don't think we want to add this. From the discussion, I was questioning our earlier approach with undef like here (see #14751).

The goal was to provide default values only if they are not defined. if IAR defines it, we should leave it as it is. a program should not use value 36 or 84 directly but rather use EILSEQ

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

But this can't compile as value 36 is already used....

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Good test !

@kjbracey-arm what do to in this case ? fix it as it is here ?

Copy link
Contributor

Choose a reason for hiding this comment

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

or @pan- but I think both are OoO these days.

Lets get back to this one the next week.

#else
#ifndef EILSEQ
#define EILSEQ 84 /* Illegal byte sequence */
#endif
#endif

#ifndef ERESTART
#define ERESTART 285 /* Interrupted system call should be restarted */
#endif
Expand Down