Skip to content

compiler warning: double definition of macro JSON_INTERNAL_CATCH  #1213

Closed

Description

@RalfBielig
  • 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"

Activity

  1. nlohmann commented on Aug 24, 2018

    @nlohmann
    Owner

    This was introduced by #1187.

    @simnalamburt Could you have a look at this please?

  2. nlohmann commented on Aug 24, 2018

    @nlohmann
    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()
    {}
  3. simnalamburt commented on Aug 24, 2018

    @simnalamburt
    Contributor

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

  4. added a commit that references this issue on Aug 24, 2018
    aada309
  5. added a commit that references this issue on Aug 24, 2018
    04597c3
  6. added this to the Release 3.2.1 milestone on Aug 24, 2018
  7. self-assigned this
    on Aug 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions