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

picojson does not support -fno-exceptions #117

Open
rhysd opened this issue May 28, 2019 · 3 comments · May be fixed by #118
Open

picojson does not support -fno-exceptions #117

rhysd opened this issue May 28, 2019 · 3 comments · May be fixed by #118

Comments

@rhysd
Copy link

rhysd commented May 28, 2019

Repro

  1. Put file as foo.cc with below content
  2. 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
Copy link

DBJDBJ commented Nov 18, 2019

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
Copy link
Author

rhysd commented Nov 18, 2019

at least libc++ supports -fno-exceptions

https://reviews.llvm.org/D20677

@DBJDBJ
Copy link

DBJDBJ commented Nov 18, 2019

Go ahead: fork and pull :)

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 a pull request may close this issue.

2 participants