You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Compiling Nim code with cpp and --noCppExceptions generates C++ exception handling code.
If compiled with --passC:-fno-exceptions option to disable C++ exception, backend C++ compiler produces compile error.
testcpp.nim:
echo"hello"
Nim Version
Nim Compiler Version 2.1.1 [Linux: amd64]
Compiled at 2023-11-28
Copyright (c) 2006-2023 by Andreas Rumpf
git hash: c31bbb0
active boot switches: -d:release
Current Output
$ nim cpp --exceptions:quirky --passC:-fno-exceptions --noCppExceptions testcpp.nim
CC: ../nim-2.1.1/lib/system.nim
/tmp/nimcache123/testcpp/debug/@m..@snim-2.1.1@slib@ssystem.nim.cpp: In function 'void sysFatal__system_u4758(NimStringV2)':
/tmp/nimcache123/testcpp/debug/@m..@snim-2.1.1@slib@ssystem.nim.cpp:2641:27: error: exception handling disabled, use '-fexcepti
ons' to enable
2641 | catch (Exception* T3_) {
| ^~~
Expected Output
With `--noCppExceptions` option, Nim doesn't produce C++ exception handling code and backend C++ compiler compiles generated Code without error even if C++ exception is disabled.
Possible Solution
No response
Additional Information
Compiling with following command line success without errors:
nim cpp --exceptions:quirky --passC:-fno-exceptions testcpp.nim nim cpp --exceptions:quirky --passC:-fno-exceptions -d:noCppExceptions testcpp.nim
Description
Compiling Nim code with cpp and
--noCppExceptions
generates C++ exception handling code.If compiled with
--passC:-fno-exceptions
option to disable C++ exception, backend C++ compiler produces compile error.testcpp.nim:
Nim Version
Nim Compiler Version 2.1.1 [Linux: amd64]
Compiled at 2023-11-28
Copyright (c) 2006-2023 by Andreas Rumpf
git hash: c31bbb0
active boot switches: -d:release
Current Output
Expected Output
Possible Solution
No response
Additional Information
Compiling with following command line success without errors:
It seems
nocppexceptions
command line option definesnoCppExceptions
inhttps://github.com/nim-lang/Nim/blob/devel/compiler/commands.nim#L1060
but Nim generates exception handling C++ code.
The text was updated successfully, but these errors were encountered: