picojson does not support -fno-exceptions
Opened this issue · 3 comments
rhysd commented
Repro
- Put file as
foo.cc
with below content - Run
clang++ -fno-exceptions foo.cc
#include "/path/to/picojson.h"
int main() { return 0; }
// foo.cc
Expected
It compiles successfully
Actual
Many compilation errors for example:
picojson.h:1142:3: error: cannot use 'throw' with exceptions disabled
PICOJSON_ASSERT(0);
^
DBJDBJ commented
As long as PICO JSON uses std:: it will not be usable in "no exceptions" projects.
Since PICO JSON is "pico" it will be not a big job (I assume) to make it usable with alternatives to std:: containers. One example is EASTL.
The first step might be a slight redesign so that PICO JSON itself does not throw exceptions.
rhysd commented
at least libc++ supports -fno-exceptions
DBJDBJ commented
Go ahead: fork and pull :)