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 C99 flags so C++11 methods can be used. #19

Closed
AV00 opened this issue Feb 9, 2017 · 13 comments

Comments

Projects
None yet
2 participants
@AV00
Copy link
Contributor

commented Feb 9, 2017

Currently in c++config.h (I guess created by configure script) _GLIBCXX_USE_C99 is undefined.
This in turn prevents C++11 methods such as std::to_string() to work (they're undefined too), so to do such string manipulation you either have to use the c-library or string streams.

Thanks.

@sba1

This comment has been minimized.

Copy link
Owner

commented Feb 10, 2017

I'm not sure if clib2 or newlib are really full C99 libraries. Please have a look at this: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58393

If I understood it correctly, then it means that in GCC 6 the requirements were a bit relaxed.

I see three possibilities:

  1. We use GCC 6 (this still has issues) and hope that the support will be automatically enabled. Indeed I plan to have concurrent releases of adtools gcc packaged.

  2. We enforce the definition of that macro and hope for the best

  3. We relax the requirements in GCC 5 and allow in particular when clib or newlib is used or use we try the patch that have been added to the bug.

@AV00

This comment has been minimized.

Copy link
Contributor Author

commented Feb 11, 2017

sba1 added a commit that referenced this issue Mar 4, 2017

@sba1

This comment has been minimized.

Copy link
Owner

commented Mar 4, 2017

I made few changes. You still have to undef __STRICT_ANSI__ when compiling files. For instance, -std=c++11 -U__STRICT_ANSI__.

@AV00

This comment has been minimized.

Copy link
Contributor Author

commented Mar 7, 2017

Ok, I've tried and the newest patch works with newlib, not clib2. Which is an improvement of course. I see you also forced the undefinition of STRICT_ANSI in the header.

In the comments you wrote that you're waiting for newlib to be fixed. Shall we keep the issue open in the meantime ? Or close it ?

@sba1

This comment has been minimized.

Copy link
Owner

commented Mar 7, 2017

Which is an improvement of course. I see you also forced the undefinition of STRICT_ANSI in the header.

Yes, unfortunately this seems to be necessary with current newlib SDK (the includes don't know about C99).

In the comments you wrote that you're waiting for newlib to be fixed. Shall we keep the issue open in the meantime ? Or close it ?

I would like to keep this open as long as the clib2 variant does suffer from the same problem. Best would be to address this issue within clib2 directly if possible,

@AV00

This comment has been minimized.

Copy link
Contributor Author

commented Mar 7, 2017

Yes, agreed. The same could be said for newlib. Having to undefine that flag feels... wrong.

It is. But it is also a problem of GCC 5 libstdc++/configure. It performs its checks with c++98 mode which doesn't define the C99 macro but __STRICT_ANSI__.

@sba1

This comment has been minimized.

Copy link
Owner

commented May 23, 2018

I think that the problem is mostly fixed with gcc 8. Missing features are more a problem of the respective clibs.

@sba1 sba1 closed this May 23, 2018

@AV00

This comment has been minimized.

Copy link
Contributor Author

commented May 31, 2018

@sba1

This comment has been minimized.

Copy link
Owner

commented May 31, 2018

@AV00

This comment has been minimized.

Copy link
Contributor Author

commented Jun 1, 2018

@sba1

This comment has been minimized.

Copy link
Owner

commented Jun 1, 2018

@AV00

This comment has been minimized.

Copy link
Contributor Author

commented Jun 4, 2018

@sba1

This comment has been minimized.

Copy link
Owner

commented Jun 4, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.