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

Avoid further trycatch and throw when exceptions are disabled #1403

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Nov 18, 2024

  1. trycatch: do not try catch when no exceptions is enabled

    For WASM targets the `cc` crate changed to always set `-fno-exceptions`,
    before only `-fignore-exceptions` was being set elsewhere, so now programs
    fail to build when using `cxx` if any `throw` or `try ... catch` are used.
    
    > error: cannot use 'try' with exceptions disabled
    
    Instead for trycatch just call `func()`.
    ahayzen-kdab committed Nov 18, 2024
    Configuration menu
    Copy the full SHA
    7c3fde0 View commit details
    Browse the repository at this point in the history
  2. result: without exception do not throw when Result Err just abort

    For WASM targets the `cc` crate changed to always set `-fno-exceptions`,
    before only `-fignore-exceptions` was being set elsewhere, so now programs
    fail to build when using `cxx` if any `throw` or `try ... catch` are used.
    
    > error: cannot use 'throw' with exceptions disabled
    
    Instead of throwing just abort.
    ahayzen-kdab committed Nov 18, 2024
    Configuration menu
    Copy the full SHA
    7a0f3f2 View commit details
    Browse the repository at this point in the history