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

compiler warning: double definition of macro JSON_INTERNAL_CATCH #1213

Closed
RalfBielig opened this issue Aug 24, 2018 · 3 comments
Closed

compiler warning: double definition of macro JSON_INTERNAL_CATCH #1213

RalfBielig opened this issue Aug 24, 2018 · 3 comments
Assignees
Labels
confirmed kind: bug solution: proposed fix a fix for the issue has been proposed and waits for confirmation
Milestone

Comments

@RalfBielig
Copy link

  • version 3.2.0
#define JSON_CATCH_USER(exception) if(false)
#include "nlohmann/json.hpp"

single_include/nlohmann/json.hpp:211:0: warning: "JSON_INTERNAL_CATCH" redefined
single_include/nlohmann/json.hpp:198:0: first definition of macro "JSON_INTERNAL_CATCH"

@nlohmann
Copy link
Owner

This was introduced by #1187.

@simnalamburt Could you have a look at this please?

@nlohmann
Copy link
Owner

I can confirm the warning. Minimal compilable program:

#define JSON_TRY_USER if(true)
#define JSON_CATCH_USER(exception) if(false)
#include "single_include/nlohmann/json.hpp"

int main()
{}

@simnalamburt
Copy link
Contributor

Oops I catched the mistake. I'll send a follow-up PR

simnalamburt added a commit to devsisters/json that referenced this issue Aug 24, 2018
nlohmann added a commit that referenced this issue Aug 24, 2018
@nlohmann nlohmann added this to the Release 3.2.1 milestone Aug 24, 2018
@nlohmann nlohmann added the solution: proposed fix a fix for the issue has been proposed and waits for confirmation label Aug 24, 2018
@nlohmann nlohmann self-assigned this Aug 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed kind: bug solution: proposed fix a fix for the issue has been proposed and waits for confirmation
Projects
None yet
Development

No branches or pull requests

3 participants