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

<iostream> still included in embedded systems #86

Open
pirgia opened this issue May 23, 2024 · 0 comments
Open

<iostream> still included in embedded systems #86

pirgia opened this issue May 23, 2024 · 0 comments

Comments

@pirgia
Copy link

pirgia commented May 23, 2024

I know the issue has already been reported in issue #57 and the following code:

#if defined(__STDC_HOSTED__)
#    define FLUENT_HOSTED 1
#else
#    define FLUENT_HOSTED 0
#endif

was added to disable the inclusion of <iostream> for freestanding compilers.
Unfortunately, for the STM32 microcontrollers at least, __STDC_HOSTED__ is defined and is equal to 1, so <iostream> is still included.
Setting the -ffreestanding flag is of little use as this has many more undesired collateral effects beyond setting __STDC_HOSTED__ to 0.
The footprint of <iostream> is around 150 kB, which is an enormous amount in my embedded world.

Would it be possible to add a user defined macro that (in conjunction with the __STDC_HOSTED__ macro) enables or disables the inclusion of the <iostream> library?

Thanks for your attention.

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

No branches or pull requests

1 participant