Skip to content

__EXCEPTIONS is still defined as 1 without -fexceptions #25500

@HenryAWE

Description

@HenryAWE

Version of emscripten/emsdk:

emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 4.0.15 (09f52557f0d48b65b8c724853ed8f4e8bf80e669)
clang version 22.0.0git (https:/github.com/llvm/llvm-project 3388d40684742e950b3c5d1d2dafe5a40695cfc1)
Target: wasm32-unknown-emscripten
Thread model: posix

According to the document, emcc disable exceptions by default,
but compile the code without -fexceptions, it still outputs 1

#ifdef __EXCEPTIONS
    std::cout << __EXCEPTIONS;
#endif

Some library use the macro to detect exceptions support at compile-time

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions