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

#include <exception> for a direct dependency #8978

Merged
merged 2 commits into from
Jul 25, 2024
Merged

Conversation

jpinkul
Copy link
Contributor

@jpinkul jpinkul commented Aug 23, 2023

I was recently trying to compile this project with a more recent version of GCC and hit an issue with this file. With older versions the std::set_terminate definition was being included via a transitive include of <exception> from the C++ standard library implementation. This is no longer the case with newer versions of libstdc++. This fixes the issue by using a direct include instead of relying on an implementation specific transitive include.

@earlephilhower
Copy link
Collaborator

earlephilhower commented Aug 23, 2023

This seems fine, but using exceptions unpatched from a generic GCC will result in the exception unwind tables living in RAM. It'll work, but you're going to spend a large portion of usable RAM on them. See the esp-quick-toolchain for some patches against the current GCC.

-edit- Actually, you may be OK. The linker will place the unwind tables in flash and if you use the unaligned read exception code (slow, but works) it might just be fine. If you don't then the unwinder will attempt to do byte-wide accesses to those tables ruining your day.

@mcspr mcspr changed the title Include the exception header for a direct dependency #include <exception> for a direct dependency Jul 25, 2024
@mcspr mcspr merged commit e4887b7 into esp8266:master Jul 25, 2024
28 checks passed
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

Successfully merging this pull request may close these issues.

3 participants